Merge lp:~julien-spautz/slingshot/fix-1200223 into lp:~elementary-pantheon/slingshot/trunk

Proposed by Julien Spautz
Status: Merged
Approved by: David Gomes
Approved revision: 371
Merged at revision: 371
Proposed branch: lp:~julien-spautz/slingshot/fix-1200223
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 50 lines (+3/-17)
1 file modified
src/Utils.vala (+3/-17)
To merge this branch: bzr merge lp:~julien-spautz/slingshot/fix-1200223
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+180317@code.launchpad.net

Commit message

Fixed bug #1200223 and Slingshot now orders accented-name apps too.

Description of the change

fix bug #1200223

also removed some whitespace and removed "using" statements

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Utils.vala'
--- src/Utils.vala 2012-08-21 17:02:33 +0000
+++ src/Utils.vala 2013-08-15 11:24:25 +0000
@@ -16,43 +16,29 @@
16// along with this program. If not, see <http://www.gnu.org/licenses/>.16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//17//
1818
19using GLib;
20using Gtk;
21using Cairo;
22
23namespace Slingshot {19namespace Slingshot {
2420
25 class Utils : GLib.Object {21 class Utils : GLib.Object {
2622
27 public static Widget set_padding (Gtk.Widget widget, int top,23 public static Gtk.Widget set_padding (Gtk.Widget widget, int top,
28 int right, int bottom, int left) {24 int right, int bottom, int left) {
29
30 widget.set_margin_top (top);25 widget.set_margin_top (top);
31 widget.set_margin_right (right);26 widget.set_margin_right (right);
32 widget.set_margin_bottom (bottom);27 widget.set_margin_bottom (bottom);
33 widget.set_margin_left (left);28 widget.set_margin_left (left);
34 return widget;29 return widget;
35
36 }30 }
3731
38 public static int sort_apps_by_popularity (Backend.App a, Backend.App b) {32 public static int sort_apps_by_popularity (Backend.App a, Backend.App b) {
39
40 return (int) (b.popularity*1000 - a.popularity*1000);33 return (int) (b.popularity*1000 - a.popularity*1000);
41
42 }34 }
4335
44 public static int sort_apps_by_name (Backend.App a, Backend.App b) {36 public static int sort_apps_by_name (Backend.App a, Backend.App b) {
4537 return a.name.collate (b.name);
46 return GLib.strcmp (a.name.down (), b.name.down ());
47
48 }38 }
4939
50 public static int sort_apps_by_relevancy (Backend.App a, Backend.App b) {40 public static int sort_apps_by_relevancy (Backend.App a, Backend.App b) {
51
52 return (int) (a.relevancy*1000 - b.relevancy*1000);41 return (int) (a.relevancy*1000 - b.relevancy*1000);
53
54 }42 }
55
56 }43 }
57
58}44}

Subscribers

People subscribed via source and target branches