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

Proposed by Michal Hruby
Status: Merged
Approved by: Paweł Stołowski
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 (community) Approve
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.
Revision history for this message
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
=== modified file 'src/daemon.vala'
--- src/daemon.vala 2012-09-06 14:12:46 +0000
+++ src/daemon.vala 2012-09-13 11:24:27 +0000
@@ -277,8 +277,12 @@
277 GLib.List<Unity.Category> categories = new GLib.List<Unity.Category> ();277 GLib.List<Unity.Category> categories = new GLib.List<Unity.Category> ();
278 File icon_dir = File.new_for_path (ICON_PATH);278 File icon_dir = File.new_for_path (ICON_PATH);
279279
280 var cat = new Unity.Category (_("Recently Used"),280 var cat = new Unity.Category (_("Applications"),
281 new FileIcon (icon_dir.get_child ("group-recent.svg")));281 new FileIcon (icon_dir.get_child ("group-apps.svg")));
282 categories.append (cat);
283
284 cat = new Unity.Category (_("Recently Used"),
285 new FileIcon (icon_dir.get_child ("group-recent.svg")));
282 categories.append (cat);286 categories.append (cat);
283287
284 cat = new Unity.Category (_("Recent Apps"),288 cat = new Unity.Category (_("Recent Apps"),
@@ -294,10 +298,6 @@
294 Unity.CategoryRenderer.FLOW);298 Unity.CategoryRenderer.FLOW);
295 categories.append (cat);299 categories.append (cat);
296300
297 cat = new Unity.Category (_("Applications"),
298 new FileIcon (icon_dir.get_child ("group-apps.svg")));
299 categories.append (cat);
300
301 lens.categories = categories;301 lens.categories = categories;
302 }302 }
303303
@@ -327,12 +327,6 @@
327 filters.append (filter);327 filters.append (filter);
328 }328 }
329329
330 /* Rating filter */
331 {
332 var filter = new RatingsFilter("rating", _("Rating"));
333 filters.append (filter);
334 }
335
336 lens.filters = filters;330 lens.filters = filters;
337 }331 }
338332
@@ -895,7 +889,6 @@
895 uint max_add=0)889 uint max_add=0)
896 {890 {
897 var appmanager = AppInfoManager.get_default();891 var appmanager = AppInfoManager.get_default();
898 var ratings_filter = scope.get_filter ("rating") as RatingsFilter;
899 uint n_added = 0;892 uint n_added = 0;
900893
901 foreach (var pkginfo in results.results)894 foreach (var pkginfo in results.results)
@@ -953,19 +946,6 @@
953 if (app != null)946 if (app != null)
954 continue;947 continue;
955948
956 /* Filter by app rating in Software Center if enabled */
957 if (ratings != null && ratings_filter.rating > 0.00001)
958 {
959 Unity.Ratings.Result result;
960 if (ratings.query (pkginfo.package_name, out result))
961 {
962 if (result.average_rating < ratings_filter.rating * 5 - 0.2)
963 continue;
964 }
965 else
966 continue;
967 }
968
969 /* Apps that are not installed, ie. in the Available category949 /* Apps that are not installed, ie. in the Available category
970 * use the 'unity-install://pkgname/Full App Name' URI scheme,950 * use the 'unity-install://pkgname/Full App Name' URI scheme,
971 * but only use that after we've de-duped the results.951 * but only use that after we've de-duped the results.
972952
=== modified file 'src/schemas.vala'
--- src/schemas.vala 2012-01-18 13:16:34 +0000
+++ src/schemas.vala 2012-09-13 11:24:27 +0000
@@ -31,11 +31,11 @@
31 31
32 public enum Category32 public enum Category
33 {33 {
34 APPLICATIONS,
34 RECENT,35 RECENT,
35 RECENT_APPS,36 RECENT_APPS,
36 INSTALLED,37 INSTALLED,
37 AVAILABLE,38 AVAILABLE,
38 APPLICATIONS,
39 }39 }
40 40
41 public enum RunnerCategory41 public enum RunnerCategory

Subscribers

People subscribed via source and target branches