diff options
author | Ted Gould <ted@gould.cx> | 2013-08-21 16:40:00 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-08-21 16:40:00 +0000 |
commit | ff533d23778b9799765bfed600b676dc30a934db (patch) | |
tree | 4df30a7d77913e5a432fe7c1023c58cb4effc229 /src/messages-service.c | |
parent | 933deb6d32c36e8bf6db23d5673982cab788337a (diff) | |
parent | f96b5cf389899d0cc4b7f389d8dd8ec3e9e89489 (diff) | |
download | ayatana-indicator-messages-ff533d23778b9799765bfed600b676dc30a934db.tar.gz ayatana-indicator-messages-ff533d23778b9799765bfed600b676dc30a934db.tar.bz2 ayatana-indicator-messages-ff533d23778b9799765bfed600b676dc30a934db.zip |
Add a DBus error for list_add().
Approved by Charles Kerr, PS Jenkins bot.
Diffstat (limited to 'src/messages-service.c')
-rw-r--r-- | src/messages-service.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 0eec2ad..a8deb6a 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -44,6 +44,12 @@ static IndicatorMessagesService *messages_service; static GHashTable *menus; static GSettings *settings; +enum { + DBUS_ERROR_BAD_DESKTOP_FILE, +}; + +G_DEFINE_QUARK(indicator_messages_dbus_error, dbus_error); + static void register_application (IndicatorMessagesService *service, GDBusMethodInvocation *invocation, @@ -54,7 +60,10 @@ register_application (IndicatorMessagesService *service, GDBusConnection *bus; const gchar *sender; - im_application_list_add (applications, desktop_id); + 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; + } bus = g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (service)); sender = g_dbus_method_invocation_get_sender (invocation); @@ -126,6 +135,9 @@ on_bus_acquired (GDBusConnection *bus, const gchar *profile; ImMenu *menu; + /* Register some errors */ + g_dbus_error_register_error (dbus_error_quark(), DBUS_ERROR_BAD_DESKTOP_FILE, "BadDesktopFile"); + g_dbus_connection_export_action_group (bus, INDICATOR_MESSAGES_DBUS_OBJECT, im_application_list_get_action_group (applications), &error); |