Merge lp:~themuso/libdbusmenu/remove-underscores into lp:libdbusmenu/0.6

Proposed by Luke Yelavich
Status: Merged
Merged at revision: 385
Proposed branch: lp:~themuso/libdbusmenu/remove-underscores
Merge into: lp:libdbusmenu/0.6
Diff against target: 25 lines (+7/-1)
1 file modified
libdbusmenu-gtk/client.c (+7/-1)
To merge this branch: bzr merge lp:~themuso/libdbusmenu/remove-underscores
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+96689@code.launchpad.net

Description of the change

Remove the underscores used for mnewmonics, as orca speaks them, which is not
what we want.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

There was a slight memory leak with setname in the regex case. But I
fixed it on merge.

  review approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-gtk/client.c'
2--- libdbusmenu-gtk/client.c 2012-03-08 05:15:06 +0000
3+++ libdbusmenu-gtk/client.c 2012-03-09 00:36:16 +0000
4@@ -736,6 +736,7 @@
5 }
6
7 const gchar * setname = NULL;
8+ const gchar * label = NULL;
9
10 if (variant != NULL) {
11 setname = g_variant_get_string(variant, NULL);
12@@ -746,7 +747,12 @@
13 * causes tests to fail.
14 */
15 if (setname == NULL) {
16- setname = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL);
17+ /* We don't want the underscore for mnewmonics */
18+ label = dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL);
19+
20+ GRegex * regex = g_regex_new ("_", 0, 0, NULL);
21+ setname = g_regex_replace_literal (regex, label, -1, 0, "", 0, NULL);
22+ g_regex_unref(regex);
23 }
24
25 atk_object_set_name(aobj, setname);

Subscribers

People subscribed via source and target branches

to all changes: