[gnome-shell/wip/gtk-notification: 18/22] notificationDaemon: Move nextNotificationId inside the daemon class



commit 8bec68a76de06babe4748c139fbd622174fd472a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Oct 13 23:42:59 2013 -0400

    notificationDaemon: Move nextNotificationId inside the daemon class

 js/ui/notificationDaemon.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index aa57005..c267545 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -15,8 +15,6 @@ const MessageTray = imports.ui.messageTray;
 const Params = imports.misc.params;
 const Util = imports.misc.util;
 
-let nextNotificationId = 1;
-
 // Should really be defined in Gio.js
 const BusIface = <interface name="org.freedesktop.DBus">
 <method name="GetConnectionUnixProcessID">
@@ -115,6 +113,8 @@ const FdoNotificationDaemon = new Lang.Class({
         this._notifications = {};
         this._busProxy = new Bus();
 
+        this._nextNotificationId = 1;
+
         this._trayManager = new Shell.TrayManager();
         this._trayIconAddedId = this._trayManager.connect('tray-icon-added', Lang.bind(this, 
this._onTrayIconAdded));
         this._trayIconRemovedId = this._trayManager.connect('tray-icon-removed', Lang.bind(this, 
this._onTrayIconRemoved));
@@ -238,7 +238,7 @@ const FdoNotificationDaemon = new Lang.Class({
               hints['category'] == 'presence.offline')) {
             // Ignore replacesId since we already sent back a
             // NotificationClosed for that id.
-            id = nextNotificationId++;
+            id = this._nextNotificationId++;
             Mainloop.idle_add(Lang.bind(this,
                                         function () {
                                             this._emitNotificationClosed(id, 
NotificationClosedReason.DISMISSED);
@@ -282,7 +282,7 @@ const FdoNotificationDaemon = new Lang.Class({
             ndata.notification = this._notifications[replacesId].notification;
         } else {
             replacesId = 0;
-            ndata.id = id = nextNotificationId++;
+            ndata.id = id = this._nextNotificationId++;
         }
         this._notifications[id] = ndata;
 


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