[gnome-music] Fix warnings when switching between stack pages



commit 8a05dd2073f68f7f4546df370009bf6d543af09f
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sat Dec 26 10:42:58 2015 -0600

    Fix warnings when switching between stack pages
    
    /usr/lib/python3.4/site-packages/gnomemusic/window.py:337: Warning:
    Source ID 48 was not found when attempting to remove it
      GLib.Source.remove(self.notification_handler)
    
    /usr/lib/python3.4/site-packages/gnomemusic/window.py:337: Warning:
    Source ID 3071 was not found when attempting to remove it
      GLib.Source.remove(self.notification_handler)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759882

 gnomemusic/window.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 1072d33..754eebb 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -320,6 +320,11 @@ class Window(Gtk.ApplicationWindow):
         self.toolbar._selection_menu_label.set_text(_("Click on items to select them"))
         self._stack.get_visible_child().queue_draw()
 
+    def _show_notification(self):
+        self.notification_handler = None
+        self.notification.show_all()
+        return False
+
     @log
     def _init_loading_notification(self):
         self.notification = Gd.Notification()
@@ -336,7 +341,7 @@ class Window(Gtk.ApplicationWindow):
         if self.notification_handler:
             GLib.Source.remove(self.notification_handler)
             self.notification_handler = None
-        self.notification_handler = GLib.timeout_add(1000, self.notification.show_all)
+        self.notification_handler = GLib.timeout_add(1000, self._show_notification)
 
     @log
     def _init_playlist_removal_notification(self):


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