[gnome-software] Add a similar debug hack to the popular plugin



commit c10e5915a09c99592ca2324cab806f3d0ecbb844
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 9 21:24:06 2013 -0400

    Add a similar debug hack to the popular plugin
    
    Compile with CFLAGS=-DDEBUG, and then you can set the
    GNOME_SOFTWARE_POPULAR environment variable to a comma-separated
    list of app ids which should appear as picks. Very handy
    for debugging.

 src/plugins/gs-plugin-hardcoded-popular.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-hardcoded-popular.c b/src/plugins/gs-plugin-hardcoded-popular.c
index c5d4b93..d835b9d 100644
--- a/src/plugins/gs-plugin-hardcoded-popular.c
+++ b/src/plugins/gs-plugin-hardcoded-popular.c
@@ -81,6 +81,21 @@ gs_plugin_add_popular (GsPlugin *plugin,
         const gint n = G_N_ELEMENTS (apps);
         gint d, i, k;
 
+#ifdef DEBUG
+        if (g_getenv ("GNOME_SOFTWARE_POPULAR")) {
+                gchar **popular;
+
+                popular = g_strsplit (g_getenv ("GNOME_SOFTWARE_POPULAR"), ",", 0);
+                for (i = 0; popular[i]; i++) {
+                       app = gs_app_new (popular[i]);
+                       gs_plugin_add_app (list, app);
+                }
+
+                g_strfreev (popular);
+                return TRUE;
+        }
+#endif
+
         date = g_date_time_new_now_utc ();
         d = (((gint)g_date_time_get_day_of_year (date)) % (G_N_ELEMENTS (primes) * 3)) / 3;
         g_date_time_unref (date);


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