[gnome-software] trivial: Re-instate GNOME_SOFTWARE_FEATURED to select the 'random' featured application



commit f206f3ebcf1ad6656812d2fad4dc450e3ab2cb1c
Author: Richard Hughes <richard hughsie com>
Date:   Tue Feb 4 10:30:24 2014 +0000

    trivial: Re-instate GNOME_SOFTWARE_FEATURED to select the 'random' featured application

 src/gs-plugin-loader.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 6ce5a37..8f2d66b 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -1171,6 +1171,18 @@ gs_plugin_loader_get_popular_finish (GsPluginLoader *plugin_loader,
 /******************************************************************************/
 
 /**
+ * gs_plugin_loader_featured_debug:
+ **/
+static gboolean
+gs_plugin_loader_featured_debug (GsApp *app, gpointer user_data)
+{
+       if (g_strcmp0 (gs_app_get_id_full (app),
+           g_getenv ("GNOME_SOFTWARE_FEATURED")) == 0)
+               return TRUE;
+       return FALSE;
+}
+
+/**
  * gs_plugin_loader_get_featured_thread_cb:
  **/
 static void
@@ -1195,8 +1207,12 @@ gs_plugin_loader_get_featured_thread_cb (GSimpleAsyncResult *res,
        }
 
        /* filter package list */
-       gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_valid, NULL);
-       gs_plugin_list_randomize (&state->list);
+       if (g_getenv ("GNOME_SOFTWARE_FEATURED") != NULL) {
+               gs_plugin_list_filter (&state->list, gs_plugin_loader_featured_debug, NULL);
+       } else {
+               gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_valid, NULL);
+               gs_plugin_list_randomize (&state->list);
+       }
        if (state->list == NULL) {
                g_set_error_literal (&error,
                                     GS_PLUGIN_LOADER_ERROR,


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