[gnome-software] Sort the featured subcategories up front



commit 7d5fcaaf02e905889bd72371bac67adfadd7e1fc
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Sep 18 21:43:02 2013 -0400

    Sort the featured subcategories up front
    
    Moving the 'featured' subcategories to the first position
    automatically makes them selected initially, which is the
    intended effect.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708295

 src/gs-category.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-category.c b/src/gs-category.c
index 7341fc3..0e6eb38 100644
--- a/src/gs-category.c
+++ b/src/gs-category.c
@@ -124,8 +124,13 @@ gs_category_sort_subcategories_cb (gconstpointer a, gconstpointer b)
 
        if (!id_a)
                return 1;
+       else if (g_strcmp0 (id_a, "featured") == 0)
+               return -1;
+
        if (!id_b)
                return -1;
+       else if (g_strcmp0 (id_b, "featured") == 0)
+               return 1;
 
        return g_strcmp0 (gs_category_get_name (ca), gs_category_get_name (cb));
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]