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

Proposed by Michal Hruby
Status: Merged
Approved by: Mikkel Kamstrup Erlandsen
Approved revision: 281
Merged at revision: 280
Proposed branch: lp:~mhr3/unity-lens-applications/fix-960269
Merge into: lp:unity-lens-applications
Diff against target: 27 lines (+10/-2)
2 files modified
src/unity-package-search.cc (+2/-2)
tests/test-keyword-relevancy.sh (+8/-0)
To merge this branch: bzr merge lp:~mhr3/unity-lens-applications/fix-960269
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Approve
Review via email: mp+99492@code.launchpad.net

Commit message

Set relevancies of Keywords to zero

Description of the change

Set relevancy of keywords found in the desktop files to 0, for non-zero values we could get into situation where exact match in keywords will be more relevant than a prefix match in the name which looks to the user as broken sorting.

Added a test-case to make sure this doesn't regress in the future.

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

on the one!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity-package-search.cc'
2--- src/unity-package-search.cc 2012-03-09 17:44:30 +0000
3+++ src/unity-package-search.cc 2012-03-27 11:10:23 +0000
4@@ -221,8 +221,8 @@
5 for (i = 0; i < len; i++)
6 {
7 dum1 = unity_applications_lens_utils_preprocess_string (keywords[i]);
8- indexer->index_text (dum1, 3);
9- indexer->index_text (dum1, 3, "KW");
10+ indexer->index_text (dum1, 0);
11+ indexer->index_text (dum1, 0, "KW");
12 g_free (dum1);
13 }
14
15
16=== added file 'tests/test-keyword-relevancy.sh'
17--- tests/test-keyword-relevancy.sh 1970-01-01 00:00:00 +0000
18+++ tests/test-keyword-relevancy.sh 2012-03-27 11:10:23 +0000
19@@ -0,0 +1,8 @@
20+#!/bin/sh
21+
22+# This test is pretty flaky, feel free to remove if it starts failing... :(
23+
24+# Search for display, print the results, make sure first is:
25+# gnome-display-panel.desktop
26+unity-tool -n com.canonical.Unity.Lens.Applications -p /com/canonical/unity/lens/applications -s "display" --no-search-reply -r | head -n1 | grep -q gnome-display-panel.desktop || exit 1
27+

Subscribers

People subscribed via source and target branches