[gnome-music/wip/merge: 110/343] window: correctly disconnect the signal



commit 6c94cd95aeb19ec4cc56c5916a9e5148a0f5f7ca
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Mon Jul 15 16:23:21 2013 +0200

    window: correctly disconnect the signal

 gnomemusic/window.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index f76ddda..0cd7557 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -83,7 +83,7 @@ class Window(Gtk.ApplicationWindow):
                 self._stack.add_titled(i, i.title, i.title)
 
             self._onNotifyModelId = self._stack.connect("notify::visible-child", self._onNotifyMode)
-            self.connect("destroy", self._stack.disconnect(self._onNotifyModelId))
+            self.connect("destroy", self._notifyModeDisconnect)
 
             self.views[0].populate()
         #To revert to the No Music View when no songs are found
@@ -96,6 +96,9 @@ class Window(Gtk.ApplicationWindow):
         self._box.show()
         self.show()
 
+    def _notifyModeDisconnect(self):
+        self._stack.disconnect(self._onNotifyModelId)
+
     def _onNotifyMode(self, stack, param):
         #Slide out artist list on switching to artists view
         if stack.get_visible_child() == self.views[1]:


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