[pitivi/1.0] mainwindow: Let signals disconnect automatically



commit 4928787a2ffbef4d0e0ad96422800ae3c348e193
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Mon Nov 19 23:15:21 2018 +0100

    mainwindow: Let signals disconnect automatically
    
    The signals connected by self.builder are all for the main menu.
    They are disconnected automatically when the objects are destroyed.

 pitivi/mainwindow.py | 12 ------------
 1 file changed, 12 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 4a54089c..e06d72a4 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -136,7 +136,6 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
         self.connect("destroy", self._destroyedCb)
 
         self.setupCss()
-        self.builder_handler_ids = []
         self.builder = Gtk.Builder()
 
         self._createUi()
@@ -194,9 +193,6 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
         self.menu_button_action.disconnect_by_func(self._menuCb)
         self.disconnect_by_func(self._destroyedCb)
         self.disconnect_by_func(self._configureCb)
-        for gobject, id_ in self.builder_handler_ids:
-            gobject.disconnect(id_)
-        self.builder_handler_ids = None
         self.vpaned.remove(self.timeline_ui)
         self.timeline_ui.destroy()
 
@@ -410,9 +406,6 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
         self.builder.add_from_file(
             os.path.join(get_ui_dir(), "mainmenubutton.ui"))
 
-        # FIXME : see https://bugzilla.gnome.org/show_bug.cgi?id=729263
-        self.builder.connect_signals_full(self._builderConnectCb, self)
-
         self._menubutton = self.builder.get_object("menubutton")
 
         self._menubutton_items = {}
@@ -526,11 +519,6 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
         self.save_action.set_enabled(True)
         self.updateTitle()
 
-    def _builderConnectCb(self, builder, gobject, signal_name, handler_name,
-                          connect_object, flags, user_data):
-        id_ = gobject.connect(signal_name, getattr(self, handler_name))
-        self.builder_handler_ids.append((gobject, id_))
-
 # Toolbar/Menu actions callback
 
     def _newProjectMenuCb(self, unused_action, unused_param):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]