[gnome-shell/wip/fmuellner/notification-redux: 56/82] calendar: Add some missing bits



commit 0c6bbc62ea64c8a65f1cc3325f08b851ec4f767e
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 13 10:29:00 2015 +0100

    calendar: Add some missing bits

 js/ui/calendar.js |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 400439b..e08e4b5 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1184,21 +1184,15 @@ const NotificationSection = new Lang.Class({
 
     _sourceAdded: function(tray, source) {
         let obj = {
-            sourceTitleChangedId: 0,
-            sourceDestroyId: 0,
-            sourceNotificationAdded: 0,
+            destroyId: 0,
+            notificationAddedId: 0,
         };
 
-/*
-        obj.sourceTitleChangedId = source.connect('title-changed', Lang.bind(this, function(source) {
-            this._titleChanged(source, obj);
-        }));
-        obj.sourceDestroyId = source.connect('destroy', Lang.bind(this, function(source) {
+        obj.destroyId = source.connect('destroy', Lang.bind(this, function(source) {
             this._onSourceDestroy(source, obj);
         }));
-        */
-        obj.sourceNotificationAdded = source.connect('notification-added',
-                                                     Lang.bind(this, this._onNotificationAdded));
+        obj.notificationAddedId = source.connect('notification-added',
+                                                 Lang.bind(this, this._onNotificationAdded));
 
         this._sources.set(source, obj);
     },
@@ -1225,6 +1219,13 @@ const NotificationSection = new Lang.Class({
         this._list.insert_child_below(listEntry.actor, null);
     },
 
+    _onSourceDestroy: function(source, obj) {
+        source.disconnect(obj.destroyId);
+        source.disconnect(obj.notificationAddedId);
+
+        this._sources.delete(source);
+    },
+
     addNotification: function(notification) {
         let listEntry = new NotificationListEntry(notification);
         // TODO: Keep URGENT notifications on top


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