Merge lp:~azzar1/unity/fix-850984 into lp:unity
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andrea Azzarone | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2085 | ||||
Proposed branch: | lp:~azzar1/unity/fix-850984 | ||||
Merge into: | lp:unity | ||||
Diff against target: |
475 lines (+329/-28) 9 files modified
plugins/unityshell/src/AbstractPlacesGroup.cpp (+44/-0) plugins/unityshell/src/AbstractPlacesGroup.h (+51/-0) plugins/unityshell/src/LensView.cpp (+10/-12) plugins/unityshell/src/LensViewPrivate.cpp (+48/-0) plugins/unityshell/src/LensViewPrivate.h (+40/-0) plugins/unityshell/src/PlacesGroup.cpp (+3/-12) plugins/unityshell/src/PlacesGroup.h (+3/-4) tests/CMakeLists.txt (+5/-0) tests/test_lensview_impl.cpp (+125/-0) |
||||
To merge this branch: | bzr merge lp:~azzar1/unity/fix-850984 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Review via email: mp+96843@code.launchpad.net |
Description of the change
The problem
===
Dash - Missing category separator line in dash
The fix
===
17 - bool found_one = false;
18 -
19 - for (rit = children.rbegin(); rit != children.rend(); ++rit)
20 - {
21 - PlacesGroup* group = static_
22 -
23 - if (group-
24 - group->
25 -
26 - found_one = group->IsVisible();
27 - }
If the next group is not visibile the separator is not shown in the prev group.
This branch fixes it moving the logic side in another (testable) function. I'd love to
remove the static_cast too but I can't find an easy way right now.
The test
===
Adds a unit test for the logic side.
Overall looks very good to me.
133 + std::list< AbstractPlacesG roup*> groups; children. begin() , children.end(), std::back_ inserter( groups) , roup* cast<AbstractPl acesGroup* >(obj);
134 +
135 + std::transform(
136 + [](Area* obj) -> AbstractPlacesG
137 + {
138 + return static_
139 + });
I this really much more optimized, than using a normal loop? I mean, it's a nice C++ code, but it could look more cryptic than it really is :)