Merge lp:~cando/unity/fixed683466 into lp:unity

Proposed by Stefano Candori on 2010-12-14
Status: Merged
Merged at revision: 711
Proposed branch: lp:~cando/unity/fixed683466
Merge into: lp:unity
Diff against target: 40 lines (+25/-4)
1 file modified
src/BamfLauncherIcon.cpp (+25/-4)
To merge this branch: bzr merge lp:~cando/unity/fixed683466
Reviewer Review Type Date Requested Status
Unity Team 2010-12-14 Pending
Review via email: mp+43706@code.launchpad.net

Description of the Change

In this branch i've fixed bug #683466.

Sorry for the double merge proposal...:(

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/BamfLauncherIcon.cpp'
2--- src/BamfLauncherIcon.cpp 2010-12-13 22:50:48 +0000
3+++ src/BamfLauncherIcon.cpp 2010-12-14 21:26:11 +0000
4@@ -630,11 +630,32 @@
5
6 EnsureMenuItemsReady ();
7
8- result.push_back (_menu_items["Launch"]);
9- result.push_back (_menu_items["Pin"]);
10+ std::map<std::string, DbusmenuMenuitem *>::iterator it_m;
11+ std::list<DbusmenuMenuitem *>::iterator it_l;
12+ bool exists;
13+ for (it_m = _menu_items.begin (); it_m != _menu_items.end (); it_m++)
14+ {
15+ exists = false;
16+ std::string label_default = dbusmenu_menuitem_property_get ((*it_m).second, DBUSMENU_MENUITEM_PROP_LABEL);
17+ for(it_l = result.begin(); it_l != result.end(); it_l++)
18+ {
19+ const gchar* type = dbusmenu_menuitem_property_get (*it_l, DBUSMENU_MENUITEM_PROP_TYPE);
20+ if (type == NULL)//(g_strcmp0 (type, DBUSMENU_MENUITEM_PROP_LABEL) == 0)
21+ {
22+ std::string label_menu = dbusmenu_menuitem_property_get (*it_l, DBUSMENU_MENUITEM_PROP_LABEL);
23+ if (label_menu.compare(label_default) == 0){ exists = true; break;}
24+ }
25+ }
26+
27+ if (!exists)
28+ {
29+ const char* key = ((*it_m).first).c_str();
30+ if (g_strcmp0 (key , "Quit") == 0)
31+ if (!bamf_view_is_running (BAMF_VIEW (m_App))) continue;
32
33- if (bamf_view_is_running (BAMF_VIEW (m_App)))
34- result.push_back (_menu_items["Quit"]);
35+ result.push_back((*it_m).second);
36+ }
37+ }
38
39 return result;
40 }