diff options
author | Ted Gould <ted@gould.cx> | 2013-08-19 11:17:47 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2013-08-19 11:17:47 -0500 |
commit | 3c8052130a82f0f05d2ad875f3d24fd7367321c8 (patch) | |
tree | 29c784ffd72d157cb0654959e7f55b580439aa23 /src | |
parent | 41bd58d41cd15a8ca8e4499b2abe945a4fe1667d (diff) | |
download | ayatana-indicator-messages-3c8052130a82f0f05d2ad875f3d24fd7367321c8.tar.gz ayatana-indicator-messages-3c8052130a82f0f05d2ad875f3d24fd7367321c8.tar.bz2 ayatana-indicator-messages-3c8052130a82f0f05d2ad875f3d24fd7367321c8.zip |
Make it so that application list returns an error on a bad desktop file
Diffstat (limited to 'src')
-rw-r--r-- | src/im-application-list.c | 8 | ||||
-rw-r--r-- | src/im-application-list.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c index bba7972..14af69b 100644 --- a/src/im-application-list.c +++ b/src/im-application-list.c @@ -576,7 +576,7 @@ im_application_list_activate_app_action (GSimpleAction *action, g_desktop_app_info_launch_action (app->info, g_action_get_name (G_ACTION (action)), NULL); } -void +gboolean im_application_list_add (ImApplicationList *list, const gchar *desktop_id) { @@ -590,13 +590,13 @@ im_application_list_add (ImApplicationList *list, g_return_if_fail (desktop_id != NULL); if (im_application_list_lookup (list, desktop_id)) - return; + return TRUE; info = g_desktop_app_info_new (desktop_id); if (!info) { g_warning ("an application with id '%s' is not installed", desktop_id); - return; + return FALSE; } id = g_app_info_get_id (G_APP_INFO (info)); @@ -645,6 +645,8 @@ im_application_list_add (ImApplicationList *list, g_object_unref (launch_action); g_object_unref (actions); + + return TRUE; } void diff --git a/src/im-application-list.h b/src/im-application-list.h index f1de220..65e3326 100644 --- a/src/im-application-list.h +++ b/src/im-application-list.h @@ -36,7 +36,7 @@ GType im_application_list_get_type (void); ImApplicationList * im_application_list_new (void); -void im_application_list_add (ImApplicationList *list, +gboolean im_application_list_add (ImApplicationList *list, const gchar *desktop_id); void im_application_list_remove (ImApplicationList *list, |