From 1f621cbbbfe9bc65f4fbce2ff2bb57ef8badad82 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 21 Aug 2012 00:52:58 -0500 Subject: in app-section.c's dispose(), clear the muxer object --- src/app-section.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app-section.c b/src/app-section.c index 1602ac6..4cccb6c 100644 --- a/src/app-section.c +++ b/src/app-section.c @@ -233,6 +233,8 @@ app_section_dispose (GObject *object) g_clear_object (&priv->source_actions); } + g_clear_object (&priv->muxer); + g_clear_object (&priv->source_menu); g_clear_object (&priv->ids); g_clear_object (&priv->appinfo); -- cgit v1.2.3 From 19f5fdbb523167af107267c2bb28a810b5a548a2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 21 Aug 2012 00:54:03 -0500 Subject: in app-section's app_section_set_app_info(), don't leak the nicks' actions --- src/app-section.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app-section.c b/src/app-section.c index 4cccb6c..fcb75d9 100644 --- a/src/app-section.c +++ b/src/app-section.c @@ -352,6 +352,7 @@ app_section_set_app_info (AppSection *self, action = g_simple_action_new (nicks[i], NULL); g_signal_connect(action, "activate", G_CALLBACK (nick_activate_cb), self); g_simple_action_group_insert (priv->static_shortcuts, G_ACTION (action)); + g_object_unref (action); g_menu_append (priv->menu, name, nicks[i]); -- cgit v1.2.3 From 2f2630580f5e473f0748fcedd52164c350285a00 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 21 Aug 2012 00:55:26 -0500 Subject: in app-section.c's activate_cb(), don't leak the GError if we can't launch --- src/app-section.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app-section.c b/src/app-section.c index fcb75d9..f922dca 100644 --- a/src/app-section.c +++ b/src/app-section.c @@ -387,8 +387,10 @@ activate_cb (GSimpleAction *action, GError *error = NULL; if (!g_app_info_launch (G_APP_INFO (priv->appinfo), NULL, NULL, &error)) { - g_warning("Unable to execute application for desktop file '%s'", - g_desktop_app_info_get_filename (priv->appinfo)); + g_warning("Unable to execute application for desktop file '%s': %s", + g_desktop_app_info_get_filename (priv->appinfo), + error->message); + g_error_free (error); } } -- cgit v1.2.3 From 17d00fcd9f594ee938595a8c9a337cbd8c98cd27 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 21 Aug 2012 13:26:30 +0200 Subject: Bump glib and gtk dependencies --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f9f00e9..4bf55b0 100644 --- a/configure.ac +++ b/configure.ac @@ -38,11 +38,11 @@ AC_PROG_CXX # Dependencies ########################### -GTK_REQUIRED_VERSION=3.0 -GIO_UNIX_REQUIRED_VERSION=2.18 +GTK_REQUIRED_VERSION=3.5.12 +GIO_UNIX_REQUIRED_VERSION=2.33.10 PANEL_REQUIRED_VERSION=2.0.0 INDICATOR_REQUIRED_VERSION=0.3.19 -GLIB_REQUIRED_VERSION=2.31.20 +GLIB_REQUIRED_VERSION=2.33.10 INTROSPECTION_REQUIRED_VERSION=1.32.0 PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK_REQUIRED_VERSION -- cgit v1.2.3 From 7272017b49f5ee3aa9033e12271986cd5534f1c1 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 21 Aug 2012 13:27:02 +0200 Subject: configure.ac: remove unused variable --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4bf55b0..d9270dd 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,6 @@ AC_PROG_CXX GTK_REQUIRED_VERSION=3.5.12 GIO_UNIX_REQUIRED_VERSION=2.33.10 -PANEL_REQUIRED_VERSION=2.0.0 INDICATOR_REQUIRED_VERSION=0.3.19 GLIB_REQUIRED_VERSION=2.33.10 INTROSPECTION_REQUIRED_VERSION=1.32.0 -- cgit v1.2.3 From d0e1bf194504adc68a87423c74b8dbb3896be87a Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Tue, 21 Aug 2012 17:23:15 +0200 Subject: libmessaging-menu: fix export-symbols-regex --- libmessaging-menu/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmessaging-menu/Makefile.am b/libmessaging-menu/Makefile.am index 187e6dc..d0f941f 100644 --- a/libmessaging-menu/Makefile.am +++ b/libmessaging-menu/Makefile.am @@ -18,7 +18,7 @@ libmessaging_menu_la_CFLAGS = \ $(GIO_CFLAGS) \ -Wall -libmessaging_menu_la_LDFLAGS = -export-symbols-regex="^messaging_menu_.*" +libmessaging_menu_la_LDFLAGS = -export-symbols-regex "^messaging_menu_.*" BUILT_SOURCES = \ indicator-messages-service.c \ -- cgit v1.2.3 From 52875e80b988a7f0c5af3d4ebe720917f93c873d Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Thu, 23 Aug 2012 10:37:04 +0200 Subject: libmessaging-menu: warn when desktop_id is NULL (instead of crashing) --- libmessaging-menu/messaging-menu.c | 22 ++++++++++++++++------ 1 file 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 @@ -74,6 +74,21 @@ static void global_status_changed (IndicatorMessagesService *service, const gchar *status_str, 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, @@ -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: -- cgit v1.2.3 From dd134484da92096b4116cdfb88c36756bf234722 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Thu, 23 Aug 2012 10:41:15 +0200 Subject: libmessaging-menu: annotate icon parameters with allow-none --- libmessaging-menu/messaging-menu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libmessaging-menu/messaging-menu.c b/libmessaging-menu/messaging-menu.c index b8aaf20..78fff20 100644 --- a/libmessaging-menu/messaging-menu.c +++ b/libmessaging-menu/messaging-menu.c @@ -511,7 +511,7 @@ messaging_menu_app_insert_source (MessagingMenuApp *app, * messaging_menu_app_append_source: * @app: a #MessagingMenuApp * @id: a unique identifier for the source to be added - * @icon: the icon associated with the source + * @icon: (allow-none): the icon associated with the source * @label: a user-visible string best describing the source * * Appends a new message source to the end of the section representing @app. @@ -535,7 +535,7 @@ messaging_menu_app_append_source (MessagingMenuApp *app, * @app: a #MessagingMenuApp * @position: the position at which to insert the source * @id: a unique identifier for the source to be added - * @icon: the icon associated with the source + * @icon: (allow-none): the icon associated with the source * @label: a user-visible string best describing the source * @count: the count for the source * @@ -563,7 +563,7 @@ messaging_menu_app_insert_source_with_count (MessagingMenuApp *app, * messaging_menu_app_append_source_with_count: * @app: a #MessagingMenuApp * @id: a unique identifier for the source to be added - * @icon: the icon associated with the source + * @icon: (allow-none): the icon associated with the source * @label: a user-visible string best describing the source * @count: the count for the source * @@ -589,7 +589,7 @@ void messaging_menu_app_append_source_with_count (MessagingMenuApp *app, * @app: a #MessagingMenuApp * @position: the position at which to insert the source * @id: a unique identifier for the source to be added - * @icon: the icon associated with the source + * @icon: (allow-none): the icon associated with the source * @label: a user-visible string best describing the source * @time: the time when the source was created * @@ -618,7 +618,7 @@ messaging_menu_app_insert_source_with_time (MessagingMenuApp *app, * @app: a #MessagingMenuApp * @position: the position at which to insert the source * @id: a unique identifier for the source to be added - * @icon: the icon associated with the source + * @icon: (allow-none): the icon associated with the source * @label: a user-visible string best describing the source * @time: the time when the source was created * @@ -645,7 +645,7 @@ messaging_menu_app_append_source_with_time (MessagingMenuApp *app, * @app: a #MessagingMenuApp * @position: the position at which to insert the source * @id: a unique identifier for the source to be added - * @icon: the icon associated with the source + * @icon: (allow-none): the icon associated with the source * @label: a user-visible string best describing the source * @str: a string associated with the source * @@ -674,7 +674,7 @@ messaging_menu_app_insert_source_with_string (MessagingMenuApp *app, * @app: a #MessagingMenuApp * @position: the position at which to insert the source * @id: a unique identifier for the source to be added - * @icon: the icon associated with the source + * @icon: (allow-none): the icon associated with the source * @label: a user-visible string best describing the source * @str: a string associated with the source * -- cgit v1.2.3 From d519ebfb52d69765f4e1ec0aa3f115f2c04c9bb4 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Thu, 23 Aug 2012 12:20:21 +0200 Subject: libmessaging-menu: remove sources when they are activated Applications shouldn't leave message sources that the user clicked on in the messaging menu. This patch spares apps from having to call remove_source in all of their handlers. --- libmessaging-menu/messaging-menu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmessaging-menu/messaging-menu.c b/libmessaging-menu/messaging-menu.c index 78fff20..daeaeb5 100644 --- a/libmessaging-menu/messaging-menu.c +++ b/libmessaging-menu/messaging-menu.c @@ -419,6 +419,8 @@ source_action_activated (GTupleAction *action, const gchar *name = g_action_get_name (G_ACTION (action)); GQuark q = g_quark_from_string (name); + messaging_menu_app_remove_source (app, name); + g_signal_emit (app, signals[ACTIVATE_SOURCE], q, name); } -- cgit v1.2.3 From 95aa2195c3e7e5873a1508e77b8305cf92e2215b Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Thu, 23 Aug 2012 12:23:24 +0200 Subject: libmessaging-menu: don't warn when removing a non-existant source --- libmessaging-menu/messaging-menu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libmessaging-menu/messaging-menu.c b/libmessaging-menu/messaging-menu.c index daeaeb5..69fb3b7 100644 --- a/libmessaging-menu/messaging-menu.c +++ b/libmessaging-menu/messaging-menu.c @@ -716,10 +716,7 @@ messaging_menu_app_remove_source (MessagingMenuApp *app, g_return_if_fail (source_id != NULL); if (g_simple_action_group_lookup (app->source_actions, source_id) == NULL) - { - g_warning ("%s: a source with id '%s' doesn't exist", G_STRFUNC, source_id); return; - } n_items = g_menu_model_get_n_items (G_MENU_MODEL (app->menu)); for (i = 0; i < n_items; i++) -- cgit v1.2.3