Merge lp:~ted/libdbusmenu/regex_merge into lp:libdbusmenu/0.6

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 389
Merge reported by: Charles Kerr
Merged at revision: not available
Proposed branch: lp:~ted/libdbusmenu/regex_merge
Merge into: lp:libdbusmenu/0.6
Diff against target: 40 lines (+12/-9)
1 file modified
libdbusmenu-gtk/client.c (+12/-9)
To merge this branch: bzr merge lp:~ted/libdbusmenu/regex_merge
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Review via email: mp+98572@code.launchpad.net

Description of the change

Quick fixero for a warning that comes up a lot with unity-panel-service about not having a label. It comes from custom items. This fixes it.

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libdbusmenu-gtk/client.c'
--- libdbusmenu-gtk/client.c 2012-03-09 17:07:52 +0000
+++ libdbusmenu-gtk/client.c 2012-03-21 04:00:26 +0000
@@ -738,24 +738,27 @@
738738
739 if (variant != NULL) {739 if (variant != NULL) {
740 const gchar * setname = NULL;740 const gchar * setname = NULL;
741 setname = g_variant_dup_string(variant, NULL);741 setname = g_variant_get_string(variant, NULL);
742 atk_object_set_name(aobj, setname);742 atk_object_set_name(aobj, setname);
743 } else {743 } else {
744 /* The atk docs advise to set the name of the atk object to an empty744 /* The atk docs advise to set the name of the atk object to an empty
745 * string, but GTK doesn't yet do the same, and setting the name to NULL745 * string, but GTK doesn't yet do the same, and setting the name to NULL
746 * causes tests to fail.746 * causes tests to fail.
747 */747 */
748 gchar * setname = NULL;
749 const gchar * label = NULL;748 const gchar * label = NULL;
750 /* We don't want the underscore for mnewmonics */
751 label = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL);749 label = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL);
752750
753 GRegex * regex = g_regex_new ("_", 0, 0, NULL);751 if (label != NULL) {
754 setname = g_regex_replace_literal (regex, label, -1, 0, "", 0, NULL);752 gchar * setname = NULL;
755 g_regex_unref(regex);753
756754 /* We don't want the underscore for mnewmonics */
757 atk_object_set_name(aobj, setname);755 GRegex * regex = g_regex_new ("_", 0, 0, NULL);
758 g_free(setname);756 setname = g_regex_replace_literal (regex, label, -1, 0, "", 0, NULL);
757 g_regex_unref(regex);
758
759 atk_object_set_name(aobj, setname);
760 g_free(setname);
761 }
759 }762 }
760763
761 return;764 return;

Subscribers

People subscribed via source and target branches

to all changes: