From 199f3d22a194b89241a2d29519aae587f5c4b5a8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 12:29:33 -0600 Subject: Allowing for the default path if one is not given. --- src/application-service-watcher.c | 8 +++++++- src/dbus-shared.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index 81fae36..f2823dd 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -169,7 +169,13 @@ _notification_watcher_server_register_status_notifier_item (ApplicationServiceWa { ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher); - application_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), service); + const gchar * finalservice = NOTIFICATION_ITEM_DEFAULT_OBJ; + + if (service[0] == '/') { + finalservice = service; + } + + application_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), finalservice); dbus_g_method_return(method, G_TYPE_NONE); return TRUE; diff --git a/src/dbus-shared.h b/src/dbus-shared.h index da9dfef..efc57a4 100644 --- a/src/dbus-shared.h +++ b/src/dbus-shared.h @@ -28,4 +28,5 @@ with this program. If not, see . #define NOTIFICATION_WATCHER_DBUS_IFACE "org.freedesktop.StatusNotifierWatcher" #define NOTIFICATION_ITEM_DBUS_IFACE "org.freedesktop.StatusNotifierItem" +#define NOTIFICATION_ITEM_DEFAULT_OBJ "/StatusNotifierItem" -- cgit v1.2.3 From 0c8cf85f9e6aa2120a7616f0aacb8f3993894687 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 09:25:17 -0600 Subject: Adjusting so that we use the parameter if it's not an object but a path. --- src/application-service-watcher.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index f2823dd..1ad59d4 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -169,14 +169,16 @@ _notification_watcher_server_register_status_notifier_item (ApplicationServiceWa { ApplicationServiceWatcherPrivate * priv = APPLICATION_SERVICE_WATCHER_GET_PRIVATE(appwatcher); - const gchar * finalservice = NOTIFICATION_ITEM_DEFAULT_OBJ; - if (service[0] == '/') { - finalservice = service; + application_service_appstore_application_add(priv->appstore, + dbus_g_method_get_sender(method), + service); + } else { + application_service_appstore_application_add(priv->appstore, + service, + NOTIFICATION_ITEM_DEFAULT_OBJ); } - application_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), finalservice); - dbus_g_method_return(method, G_TYPE_NONE); return TRUE; } -- cgit v1.2.3