[gnome-software] Return the subcategories sorted by name



commit 5f32176af199ae9ccaf2e3d0e020c8cdf8f959df
Author: Richard Hughes <richard hughsie com>
Date:   Tue Sep 3 17:19:18 2013 +0100

    Return the subcategories sorted by name
    
    When we have better ratings data we can use that instead in the UI.

 src/gs-plugin-loader.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 47e4f1e..3e1a0f5 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -67,6 +67,16 @@ gs_plugin_loader_error_quark (void)
 }
 
 /**
+ * gs_plugin_loader_app_sort_cb:
+ **/
+static gint
+gs_plugin_loader_app_sort_cb (gconstpointer a, gconstpointer b)
+{
+       return g_strcmp0 (gs_app_get_name (GS_APP (a)),
+                         gs_app_get_name (GS_APP (b)));
+}
+
+/**
  * gs_plugin_loader_dedupe:
  */
 GsApp *
@@ -1219,6 +1229,9 @@ cd_plugin_loader_get_category_apps_thread_cb (GSimpleAsyncResult *res,
                goto out;
        }
 
+       /* sort, just in case the UI doesn't do this */
+       state->list = g_list_sort (state->list, gs_plugin_loader_app_sort_cb);
+
        /* success */
        state->ret = TRUE;
        g_object_unref (state->category);


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