Merge lp:~mhr3/unity-lens-applications/fix-985495 into lp:unity-lens-applications

Proposed by Michal Hruby
Status: Merged
Approved by: Mikkel Kamstrup Erlandsen
Approved revision: 284
Merged at revision: 283
Proposed branch: lp:~mhr3/unity-lens-applications/fix-985495
Merge into: lp:unity-lens-applications
Diff against target: 31 lines (+7/-6)
1 file modified
src/daemon.vala (+7/-6)
To merge this branch: bzr merge lp:~mhr3/unity-lens-applications/fix-985495
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+102655@code.launchpad.net

Commit message

Fix the way applications are clustered for popularity sorting

Description of the change

The popularity sorting is not working correctly in all cases, see info in attached bug.

Change the way we cluster apps. (plus lower the number of dbus roundtrips when doing empty global searches)

No tests for the sorting as this is dependent on the way user interacts with his system. (and the extra fix to reduce the roundtrips is already covered by an existing test)

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/daemon.vala'
2--- src/daemon.vala 2012-03-27 10:07:53 +0000
3+++ src/daemon.vala 2012-04-19 09:29:28 +0000
4@@ -613,10 +613,10 @@
5 var zg_search_string = prepare_zg_search_string (search.search_string,
6 null);
7
8- var results = yield zg_index.search (zg_search_string,
9- new Zeitgeist.TimeRange.anytime(),
10+ var time_range = new Zeitgeist.TimeRange.anytime ();
11+ var results = yield log.find_events (time_range,
12 zg_templates,
13- 0,
14+ Zeitgeist.StorageState.ANY,
15 40,
16 Zeitgeist.ResultType.MOST_RECENT_SUBJECTS,
17 cancellable);
18@@ -809,9 +809,10 @@
19 * will have slightly higher relevancy for item with name "Search
20 * _f_or _f_iles" than "_F_irefox", and that's not what we want)
21 */
22- int rel_a = a.relevancy / 10;
23- int rel_b = b.relevancy / 10;
24- if (rel_a == rel_b)
25+ int rel_a = a.relevancy;
26+ int rel_b = b.relevancy;
27+ int delta = (rel_a - rel_b).abs ();
28+ if (delta < 10)
29 {
30 string id_a = extract_desktop_id (a.desktop_file);
31 string id_b = extract_desktop_id (b.desktop_file);

Subscribers

People subscribed via source and target branches