aboutsummaryrefslogtreecommitdiff
path: root/libmessaging-menu
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-08-23 10:37:04 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-08-23 10:37:04 +0200
commit52875e80b988a7f0c5af3d4ebe720917f93c873d (patch)
treea1ecf97f54eac1b3cf5406480058e079c0b609a3 /libmessaging-menu
parentd0e1bf194504adc68a87423c74b8dbb3896be87a (diff)
downloadayatana-indicator-messages-52875e80b988a7f0c5af3d4ebe720917f93c873d.tar.gz
ayatana-indicator-messages-52875e80b988a7f0c5af3d4ebe720917f93c873d.tar.bz2
ayatana-indicator-messages-52875e80b988a7f0c5af3d4ebe720917f93c873d.zip
libmessaging-menu: warn when desktop_id is NULL (instead of crashing)
Diffstat (limited to 'libmessaging-menu')
-rw-r--r--libmessaging-menu/messaging-menu.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/libmessaging-menu/messaging-menu.c b/libmessaging-menu/messaging-menu.c
index 336e89c..b8aaf20 100644
--- a/libmessaging-menu/messaging-menu.c
+++ b/libmessaging-menu/messaging-menu.c
@@ -75,6 +75,21 @@ static void global_status_changed (IndicatorMessagesService *service,
gpointer user_data);
static void
+messaging_menu_app_set_desktop_id (MessagingMenuApp *app,
+ const gchar *desktop_id)
+{
+ g_return_if_fail (desktop_id != NULL);
+
+ /* no need to clean up, it's construct only */
+ app->appinfo = g_desktop_app_info_new (desktop_id);
+ if (app->appinfo == NULL)
+ {
+ g_warning ("could not find the desktop file for '%s'",
+ desktop_id);
+ }
+}
+
+static void
messaging_menu_app_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -85,12 +100,7 @@ messaging_menu_app_set_property (GObject *object,
switch (prop_id)
{
case PROP_DESKTOP_ID:
- app->appinfo = g_desktop_app_info_new (g_value_get_string (value));
- if (app->appinfo == NULL)
- {
- g_warning ("could not find the desktop file for '%s'",
- g_value_get_string (value));
- }
+ messaging_menu_app_set_desktop_id (app, g_value_get_string (value));
break;
default: