Merge lp:~mhr3/unity/fix-1067327 into lp:unity
Proposed by
Michal Hruby
Status: | Merged |
---|---|
Approved by: | Paweł Stołowski |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2844 |
Proposed branch: | lp:~mhr3/unity/fix-1067327 |
Merge into: | lp:unity |
Diff against target: |
195 lines (+142/-2) 2 files modified
UnityCore/HomeLens.cpp (+8/-2) tests/test_home_lens.cpp (+134/-0) |
To merge this branch: | bzr merge lp:~mhr3/unity/fix-1067327 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paweł Stołowski (community) | Approve | ||
PS Jenkins bot | continuous-integration | Pending | |
Review via email: mp+129869@code.launchpad.net |
Commit message
Ensure categories with non-personal results can show up before empty categories with personal results
Description of the change
Due to a bug in the CategorySorter, lenses with "personal-content" flag set were sorted before lenses without the flag even if there were 0 results. This then caused lenses without the persoanl-content flag set to be displayed below shopping lens, simple example of how it looked after sort:
1) apps.lens - 0 results
2) files.lens - 0 results
3) shopping.lens - 5 results
4) video.lens - 14 (non-personal) results
...
Included unit tests to ensure this doesn't regress.
To post a comment you must log in.
Looks good, just one suggestion - since you added temporary a_results & b_results:
10 + unsigned a_results = results_ per_category_ [cat_a] ; per_category_ [cat_b] ;
11 + unsigned b_results = results_
Can you move them up and simplify the return statement:
17 return results_ per_category_ [cat_a] > results_ per_category_ [cat_b] ;