notificationDaemon: Move nextNotificationId inside the daemon class
This won't be used by the new notification daemon. https://bugzilla.gnome.org/show_bug.cgi?id=710137
This commit is contained in:
parent
8ee0ef2cde
commit
27a86a4756
@ -15,8 +15,6 @@ const MessageTray = imports.ui.messageTray;
|
|||||||
const Params = imports.misc.params;
|
const Params = imports.misc.params;
|
||||||
const Util = imports.misc.util;
|
const Util = imports.misc.util;
|
||||||
|
|
||||||
let nextNotificationId = 1;
|
|
||||||
|
|
||||||
// Should really be defined in Gio.js
|
// Should really be defined in Gio.js
|
||||||
const BusIface = <interface name="org.freedesktop.DBus">
|
const BusIface = <interface name="org.freedesktop.DBus">
|
||||||
<method name="GetConnectionUnixProcessID">
|
<method name="GetConnectionUnixProcessID">
|
||||||
@ -115,6 +113,8 @@ const NotificationDaemon = new Lang.Class({
|
|||||||
this._notifications = {};
|
this._notifications = {};
|
||||||
this._busProxy = new Bus();
|
this._busProxy = new Bus();
|
||||||
|
|
||||||
|
this._nextNotificationId = 1;
|
||||||
|
|
||||||
this._trayManager = new Shell.TrayManager();
|
this._trayManager = new Shell.TrayManager();
|
||||||
this._trayIconAddedId = this._trayManager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
|
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));
|
this._trayIconRemovedId = this._trayManager.connect('tray-icon-removed', Lang.bind(this, this._onTrayIconRemoved));
|
||||||
@ -252,7 +252,7 @@ const NotificationDaemon = new Lang.Class({
|
|||||||
hints['category'] == 'presence.offline')) {
|
hints['category'] == 'presence.offline')) {
|
||||||
// Ignore replacesId since we already sent back a
|
// Ignore replacesId since we already sent back a
|
||||||
// NotificationClosed for that id.
|
// NotificationClosed for that id.
|
||||||
id = nextNotificationId++;
|
id = this._nextNotificationId++;
|
||||||
Mainloop.idle_add(Lang.bind(this,
|
Mainloop.idle_add(Lang.bind(this,
|
||||||
function () {
|
function () {
|
||||||
this._emitNotificationClosed(id, NotificationClosedReason.DISMISSED);
|
this._emitNotificationClosed(id, NotificationClosedReason.DISMISSED);
|
||||||
@ -296,7 +296,7 @@ const NotificationDaemon = new Lang.Class({
|
|||||||
ndata.notification = this._notifications[replacesId].notification;
|
ndata.notification = this._notifications[replacesId].notification;
|
||||||
} else {
|
} else {
|
||||||
replacesId = 0;
|
replacesId = 0;
|
||||||
ndata.id = id = nextNotificationId++;
|
ndata.id = id = this._nextNotificationId++;
|
||||||
}
|
}
|
||||||
this._notifications[id] = ndata;
|
this._notifications[id] = ndata;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user