notificationDaemon: Clean up code paths

While we really need to clean up the bad MessageTray API, this is
a quick step to allow for a cleaner codebase for the future.

https://bugzilla.gnome.org/show_bug.cgi?id=680414
This commit is contained in:
Jasper St. Pierre 2012-12-30 11:37:43 -05:00
parent c11cbff605
commit fe7ee1edc3

View File

@ -358,9 +358,7 @@ const NotificationDaemon = new Lang.Class({
let gicon = this._iconForNotificationData(icon, hints); let gicon = this._iconForNotificationData(icon, hints);
if (notification == null) { if (notification == null) {
notification = new MessageTray.Notification(source, summary, body, notification = new MessageTray.Notification(source);
{ gicon: gicon,
bannerMarkup: true });
ndata.notification = notification; ndata.notification = notification;
notification.connect('destroy', Lang.bind(this, notification.connect('destroy', Lang.bind(this,
function(n, reason) { function(n, reason) {
@ -383,12 +381,12 @@ const NotificationDaemon = new Lang.Class({
function(n, actionId) { function(n, actionId) {
this._emitActionInvoked(ndata.id, actionId); this._emitActionInvoked(ndata.id, actionId);
})); }));
} else {
notification.update(summary, body, { gicon: gicon,
bannerMarkup: true,
clear: true });
} }
notification.update(summary, body, { gicon: gicon,
bannerMarkup: true,
clear: true });
// We only display a large image if an icon is also specified. // We only display a large image if an icon is also specified.
if (icon && (hints['image-data'] || hints['image-path'])) { if (icon && (hints['image-data'] || hints['image-path'])) {
let image = null; let image = null;