Merge lp://staging/~3v1n0/unity/indicators-p into lp://staging/unity
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Marco Trevisan (Treviño) | ||||||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||||||
Merged at revision: | 2132 | ||||||||||||||||
Proposed branch: | lp://staging/~3v1n0/unity/indicators-p | ||||||||||||||||
Merge into: | lp://staging/unity | ||||||||||||||||
Diff against target: |
2730 lines (+1212/-342) 31 files modified
CMakeLists.txt (+1/-1) UnityCore/AppmenuIndicator.cpp (+37/-0) UnityCore/AppmenuIndicator.h (+45/-0) UnityCore/CMakeLists.txt (+2/-0) UnityCore/DBusIndicators.cpp (+87/-38) UnityCore/DBusIndicators.h (+5/-2) UnityCore/Indicator.cpp (+31/-11) UnityCore/Indicator.h (+11/-7) UnityCore/IndicatorEntry.cpp (+29/-24) UnityCore/IndicatorEntry.h (+12/-7) UnityCore/Indicators.cpp (+28/-7) UnityCore/Indicators.h (+31/-10) plugins/unityshell/src/PanelIndicatorEntryView.cpp (+21/-7) plugins/unityshell/src/PanelIndicatorEntryView.h (+1/-0) plugins/unityshell/src/PanelIndicatorsView.cpp (+1/-1) plugins/unityshell/src/PanelIndicatorsView.h (+1/-1) plugins/unityshell/src/PanelView.cpp (+6/-5) plugins/unityshell/src/PanelView.h (+3/-3) services/CMakeLists.txt (+1/-1) services/panel-indicator-entry-accessible.c (+2/-1) services/panel-main.c (+33/-10) services/panel-marshal.list (+1/-0) services/panel-root-accessible.c (+5/-5) services/panel-service.c (+410/-165) services/panel-service.h (+11/-4) tests/CMakeLists.txt (+15/-2) tests/test_indicator.cpp (+207/-0) tests/test_indicator_appmenu.cpp (+66/-0) tests/test_indicator_entry.cpp (+99/-22) tests/unit/TestMain.cpp (+4/-4) tests/unit/TestPanelService.cpp (+6/-4) |
||||||||||||||||
To merge this branch: | bzr merge lp://staging/~3v1n0/unity/indicators-p | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thomi Richards (community) | Approve | ||
Tim Penhey (community) | Approve | ||
Andrea Azzarone (community) | Approve | ||
Michal Hruby (community) | Approve | ||
Review via email: mp+96862@code.staging.launchpad.net |
Commit message
Updated unity-panel-service and libunity-core against the libindicator API changes
Description of the change
Updated unity-panel-service and libunity-core against the libindicator API changes
Supporting the new libindicator API into unity-panel-service and exposing them in the higher level wrapper library for future usage.
Doing this, I've performed some cleanup of the code, and in particular I've:
- Introduced the new AppmenuIndicator class to handle the appmenu indicator
(typing it differently allows us to remove the type-checking based only on the
indicator name, this is something we should keep at lower level).
- Fixed an issue in Indicator class, that didn't disconnect from signals of the removed
entries
- Removed the IsUnused / MarkUnused methods from IndicatorEntry, since they were
already deprecated since last cycle and actually useless. The visible() method can
now be used to perform a similar check.
- Removed the sscanf based matching from the panel-service.
On the unity-panel-service side I've also fixed two issues:
- When the menus are open now they are moved to the right position if their
entry has been moved (this happens when scrolling on the language selector).
- It is now synced with the compiz gsetting key used to define which keybinding
must be used to open the menus (so now, changing that value applies to both
opening and closing the indicators, not only to the open action).
On the Tests side, I've re-enabled and updated the panel-service unit-test, that now is working again, plus I've added new tests for the Indicator and AppmenuIndicator classes and updated the tests for IndicatorEntry against the new API.
Some more tests are covered on the lp:~3v1n0/unity/indicators-tests dependent branch.
Hi,
202 + // We have to do this because on certain systems X won't have time to
203 + // respond to our request for XUngrabPointer and this will cause the
204 + // menu not to show
205 + auto data = new ShowEntryData();
Can we use a smart pointer for this please? Once you use a smart pointer you won't need this:
279 + delete data;
...and there's a larger design issue around how we create Indicator instances. This code:
671 - Indicator::Ptr indicator(new Indicator(name)); r(name) ;
672 + Indicator* indptr;
673 +
674 + if (name == "libappmenu.so")
675 + indptr = new AppmenuIndicato
676 + else
677 + indptr = new Indicator(name);
678 +
679 + Indicator::Ptr indicator(indptr);
Makes me uneasy - especially this bit:
685 + >IsAppmenu( )) cast<AppmenuInd icator* >(indicator. get()); >on_show_ appmenu. connect( sigc::mem_ fun(owner_ , &Indicators: :OnShowAppMenu) );
686 + if (indicator-
687 + {
688 + AppmenuIndicator *appmenu = dynamic_
689 +
690 + if (appmenu)
691 + appmenu-
692 + }
693 +
Why are we using a boolean member variable to encode class type? Maybe I'm missing something, but why not just do this:
AppmenuIndicator *appmenu = dynamic_ cast<AppmenuInd icator* >(indicator. get());
if (appmenu) >on_show_ appmenu. connect( sigc::mem_ fun(owner_ , &Indicators: :OnShowAppMenu) );
appmenu-
..or even better, hook up the signal for all indicators, and have child classes that don't need the signal simply not use it.
This is wrong:
818 + return proxy_- >id().c_ str();
The method returns a std::string, so you don't need the ".c_str" on the end.
These:
1127 +#define COMPIZ_OPTIONS_PATH "/apps/ compiz- 1/plugins/ unityshell/ screen0/ options" KEYBINDING_ PATH COMPIZ_ OPTIONS_ PATH"/panel_ first_menu"
1128 +#define MENU_TOGGLE_
Don't need to be #defines - nor do the three #defines right above them.
In panel-service.c, I'm 99% sure there's a memory leak on line 829, where we do this:
gchar *entry_id = get_indicator_ entry_id_ by_entry (entry); table_insert (self-> priv->id2entry_ hash, entry_id, entry);
g_hash_
entry_id needs to be freed.
The points above need to be fixed. You should also get someone else to look at this (someone who understands the panel code).
Cheers,