[gnome-software] Fix the debug hack



commit 9f0ea172326bdf09eaaee8a5b60499ce06d59637
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 9 21:23:38 2013 -0400

    Fix the debug hack
    
    Can't use g_list_find_custom on a char**. Oops

 src/plugins/gs-plugin-hardcoded-featured.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/gs-plugin-hardcoded-featured.c b/src/plugins/gs-plugin-hardcoded-featured.c
index a6ad300..1d4025b 100644
--- a/src/plugins/gs-plugin-hardcoded-featured.c
+++ b/src/plugins/gs-plugin-hardcoded-featured.c
@@ -77,11 +77,22 @@ gs_plugin_add_featured (GsPlugin *plugin,
         apps = g_key_file_get_groups (kf, &n_apps)
 ;
 
+        group = NULL;
+
 #ifdef DEBUG
-        group = g_getenv ("GNOME_SOFTWARE_FEATURED");
-        if (!group ||!g_list_find_custom (apps, group, g_str_equal))
+        if (g_getenv ("GNOME_SOFTWARE_FEATURED")) {
+                const gchar *featured;
+                featured = g_getenv ("GNOME_SOFTWARE_FEATURED");
+                for (i = 0; apps[i]; i++) {
+                        if (g_strcmp0 (apps[i], featured) == 0) {
+                                group = featured;
+                                break;
+                        }
+                }
+        }
 #endif
-        {
+
+        if (!group) {
                 /* In lieu of a random number generator, just
                  * rotate the featured apps, giving each app
                  * 3 days apiece.


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