Merge lp:~mhr3/unity-lens-applications/remove-ratings-filter into lp:unity-lens-applications

Proposed by Michal Hruby on 2012-09-13
Status: Merged
Approved by: Paweł Stołowski on 2012-09-13
Approved revision: 298
Merged at revision: 297
Proposed branch: lp:~mhr3/unity-lens-applications/remove-ratings-filter
Merge into: lp:unity-lens-applications
Diff against target: 87 lines (+7/-27)
2 files modified
src/daemon.vala (+6/-26)
src/schemas.vala (+1/-1)
To merge this branch: bzr merge lp:~mhr3/unity-lens-applications/remove-ratings-filter
Reviewer Review Type Date Requested Status
Paweł Stołowski 2012-09-13 Approve on 2012-09-13
Review via email: mp+124161@code.launchpad.net

Commit Message

Remove ratings filter and ensure applications category has index 0

Description of the Change

Remove ratings filter and ensure applications category has index 0.

To post a comment you must log in.
Paweł Stołowski (stolowski) wrote :

Loooks good and works fine.

review: Approve

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-09-06 14:12:46 +0000
3+++ src/daemon.vala 2012-09-13 11:24:27 +0000
4@@ -277,8 +277,12 @@
5 GLib.List<Unity.Category> categories = new GLib.List<Unity.Category> ();
6 File icon_dir = File.new_for_path (ICON_PATH);
7
8- var cat = new Unity.Category (_("Recently Used"),
9- new FileIcon (icon_dir.get_child ("group-recent.svg")));
10+ var cat = new Unity.Category (_("Applications"),
11+ new FileIcon (icon_dir.get_child ("group-apps.svg")));
12+ categories.append (cat);
13+
14+ cat = new Unity.Category (_("Recently Used"),
15+ new FileIcon (icon_dir.get_child ("group-recent.svg")));
16 categories.append (cat);
17
18 cat = new Unity.Category (_("Recent Apps"),
19@@ -294,10 +298,6 @@
20 Unity.CategoryRenderer.FLOW);
21 categories.append (cat);
22
23- cat = new Unity.Category (_("Applications"),
24- new FileIcon (icon_dir.get_child ("group-apps.svg")));
25- categories.append (cat);
26-
27 lens.categories = categories;
28 }
29
30@@ -327,12 +327,6 @@
31 filters.append (filter);
32 }
33
34- /* Rating filter */
35- {
36- var filter = new RatingsFilter("rating", _("Rating"));
37- filters.append (filter);
38- }
39-
40 lens.filters = filters;
41 }
42
43@@ -895,7 +889,6 @@
44 uint max_add=0)
45 {
46 var appmanager = AppInfoManager.get_default();
47- var ratings_filter = scope.get_filter ("rating") as RatingsFilter;
48 uint n_added = 0;
49
50 foreach (var pkginfo in results.results)
51@@ -953,19 +946,6 @@
52 if (app != null)
53 continue;
54
55- /* Filter by app rating in Software Center if enabled */
56- if (ratings != null && ratings_filter.rating > 0.00001)
57- {
58- Unity.Ratings.Result result;
59- if (ratings.query (pkginfo.package_name, out result))
60- {
61- if (result.average_rating < ratings_filter.rating * 5 - 0.2)
62- continue;
63- }
64- else
65- continue;
66- }
67-
68 /* Apps that are not installed, ie. in the Available category
69 * use the 'unity-install://pkgname/Full App Name' URI scheme,
70 * but only use that after we've de-duped the results.
71
72=== modified file 'src/schemas.vala'
73--- src/schemas.vala 2012-01-18 13:16:34 +0000
74+++ src/schemas.vala 2012-09-13 11:24:27 +0000
75@@ -31,11 +31,11 @@
76
77 public enum Category
78 {
79+ APPLICATIONS,
80 RECENT,
81 RECENT_APPS,
82 INSTALLED,
83 AVAILABLE,
84- APPLICATIONS,
85 }
86
87 public enum RunnerCategory

Subscribers

People subscribed via source and target branches