diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-09-30 18:00:40 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-09-30 18:00:40 +0000 |
commit | d731a2a7f4433b0c7d2c6080db66460eaed1ffc1 (patch) | |
tree | e37c8b563333c30df9448bdd841ae79a8ad3cbc8 /src | |
parent | 1c566e00bfe955a77f3b158123e1bf10dc79dfab (diff) | |
parent | 8d853b9e5a607a5274d674fa98b0214ec231ec65 (diff) | |
download | ayatana-indicator-messages-d731a2a7f4433b0c7d2c6080db66460eaed1ffc1.tar.gz ayatana-indicator-messages-d731a2a7f4433b0c7d2c6080db66460eaed1ffc1.tar.bz2 ayatana-indicator-messages-d731a2a7f4433b0c7d2c6080db66460eaed1ffc1.zip |
messages-service: return TRUE from "handle-*" GDBusProxy method handlers
This is done to signify that the handlers replied to the messages. Otherwise GDBus might send another reply, depending on whether 0 or !0 was lying around on the stack.
.
Approved by Ted Gould, PS Jenkins bot.
Diffstat (limited to 'src')
-rw-r--r-- | src/im-application-list.c | 2 | ||||
-rw-r--r-- | src/messages-service.c | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c index 11156ab..772d003 100644 --- a/src/im-application-list.c +++ b/src/im-application-list.c @@ -485,7 +485,7 @@ im_application_list_class_init (ImApplicationListClass *klass) G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_STRING, + G_TYPE_VARIANT, G_TYPE_BOOLEAN); signals[SOURCE_REMOVED] = g_signal_new ("source-removed", diff --git a/src/messages-service.c b/src/messages-service.c index 954fccc..04e4fc6 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -49,7 +49,7 @@ enum { G_DEFINE_QUARK(indicator_messages_dbus_error, dbus_error); -static void +static gboolean register_application (IndicatorMessagesService *service, GDBusMethodInvocation *invocation, const gchar *desktop_id, @@ -61,7 +61,7 @@ register_application (IndicatorMessagesService *service, if (!im_application_list_add (applications, desktop_id)) { g_dbus_method_invocation_return_error(invocation, dbus_error_quark(), DBUS_ERROR_BAD_DESKTOP_FILE, "Unable to find or parse desktop file for application '%s'", desktop_id); - return; + return TRUE; } bus = g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (service)); @@ -71,9 +71,11 @@ register_application (IndicatorMessagesService *service, g_settings_strv_append_unique (settings, "applications", desktop_id); indicator_messages_service_complete_register_application (service, invocation); + + return TRUE; } -static void +static gboolean unregister_application (IndicatorMessagesService *service, GDBusMethodInvocation *invocation, const gchar *desktop_id, @@ -83,9 +85,11 @@ unregister_application (IndicatorMessagesService *service, g_settings_strv_remove (settings, "applications", desktop_id); indicator_messages_service_complete_unregister_application (service, invocation); + + return TRUE; } -static void +static gboolean set_status (IndicatorMessagesService *service, GDBusMethodInvocation *invocation, const gchar *desktop_id, @@ -104,7 +108,7 @@ set_status (IndicatorMessagesService *service, appinfo = g_desktop_app_info_new (desktop_id); if (!appinfo) { g_warning ("could not set status for '%s', there's no desktop file with that id", desktop_id); - return; + return TRUE; } id = g_app_info_get_id (G_APP_INFO (appinfo)); @@ -114,6 +118,8 @@ set_status (IndicatorMessagesService *service, indicator_messages_service_complete_set_status (service, invocation); g_object_unref (appinfo); + + return TRUE; } /* The status has been set by the user, let's tell the world! */ |