Merge lp:~themuso/unity/keep-own-copy-of-quicklist-menu-item-label into lp:unity

Proposed by Luke Yelavich
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4010
Proposed branch: lp:~themuso/unity/keep-own-copy-of-quicklist-menu-item-label
Merge into: lp:unity
Diff against target: 69 lines (+21/-7)
1 file modified
plugins/unityshell/src/unity-quicklist-menu-item-accessible.cpp (+21/-7)
To merge this branch: bzr merge lp:~themuso/unity/keep-own-copy-of-quicklist-menu-item-label
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+270774@code.launchpad.net

Commit message

Make a copy of a quicklist menu item plain text label

Likely due to changes in the gcc transition, Orca stopped speaking quicklist menu items. It seems that keeping a separate copy of the label string for a11y use allows quicklist menu items to be spoken again.

Description of the change

Make a copy of a quicklist menu item plain text label

Likely due to changes in the gcc transition, Orca stopped speaking quicklist menu items. It seems that keeping a separate copy of the label string for a11y use allows quicklist menu items to be spoken again.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ouch no.. Approved wrong branch.

There 's a FTB here due to a missing bracket (see inline comment).

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unity-quicklist-menu-item-accessible.cpp'
2--- plugins/unityshell/src/unity-quicklist-menu-item-accessible.cpp 2014-02-13 10:24:52 +0000
3+++ plugins/unityshell/src/unity-quicklist-menu-item-accessible.cpp 2015-09-21 00:21:42 +0000
4@@ -65,6 +65,8 @@
5
6 guint on_parent_selection_change_id;
7 guint on_parent_change_id;
8+
9+ gchar *name;
10 };
11
12 using unity::QuicklistMenuItem;
13@@ -94,6 +96,7 @@
14 UNITY_QUICKLIST_MENU_ITEM_ACCESSIBLE_GET_PRIVATE(self);
15
16 self->priv = priv;
17+ self->priv->name = NULL;
18 }
19
20 static void
21@@ -113,6 +116,12 @@
22 if (self->priv->on_parent_change_id != 0)
23 g_signal_handler_disconnect(object, self->priv->on_parent_change_id);
24
25+ if (self->priv->name != NULL)
26+ {
27+ g_free(self->priv->name);
28+ self->priv->name = NULL;
29+ }
30+
31 G_OBJECT_CLASS(unity_quicklist_menu_item_accessible_parent_class)->dispose(object);
32 }
33
34@@ -198,23 +207,28 @@
35 static const gchar*
36 unity_quicklist_menu_item_accessible_get_name(AtkObject* obj)
37 {
38- const gchar* name = NULL;
39-
40 g_return_val_if_fail(UNITY_IS_QUICKLIST_MENU_ITEM_ACCESSIBLE(obj), NULL);
41-
42- name = ATK_OBJECT_CLASS(unity_quicklist_menu_item_accessible_parent_class)->get_name(obj);
43- if (name == NULL)
44+ UnityQuicklistMenuItemAccessible *self = UNITY_QUICKLIST_MENU_ITEM_ACCESSIBLE(obj);
45+
46+ if (self->priv->name)
47+ {
48+ g_free(self->priv->name);
49+ self->priv->name = NULL;
50+ }
51+
52+ self->priv->name = g_strdup(ATK_OBJECT_CLASS(unity_quicklist_menu_item_accessible_parent_class)->get_name(obj));
53+ if (self->priv->name == NULL)
54 {
55 QuicklistMenuItem* menu_item = NULL;
56
57 menu_item = dynamic_cast<QuicklistMenuItem*>(nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj)));
58 if (menu_item != NULL)
59 {
60- name = menu_item->GetPlainTextLabel().c_str();
61+ self->priv->name = g_strdup(menu_item->GetPlainTextLabel().c_str());
62 }
63 }
64
65- return name;
66+ return self->priv->name;
67 }
68
69 static AtkStateSet*