[gnome-software] Never show installed software in the 'Picks' section



commit 6b9a529358a161ffb3cd8a939eeef292df23fd73
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jul 8 20:07:03 2014 +0100

    Never show installed software in the 'Picks' section
    
    We've got enough data now to actually show useful entries.

 src/gs-plugin-loader.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index d1f0f17..b95d4cd 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -540,6 +540,19 @@ gs_plugin_loader_app_is_non_system (GsApp *app, gpointer user_data)
 }
 
 /**
+ * gs_plugin_loader_app_is_non_installed:
+ **/
+static gboolean
+gs_plugin_loader_app_is_non_installed (GsApp *app, gpointer user_data)
+{
+       if (gs_app_get_state (app) == AS_APP_STATE_INSTALLED)
+               return FALSE;
+       if (gs_app_get_state (app) == AS_APP_STATE_UPDATABLE)
+               return FALSE;
+       return TRUE;
+}
+
+/**
  * gs_plugin_loader_get_app_is_compatible:
  */
 static gboolean
@@ -1125,6 +1138,7 @@ gs_plugin_loader_get_popular_thread_cb (GTask *task,
 
        /* filter package list */
        gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_valid, NULL);
+       gs_plugin_list_filter (&state->list, gs_plugin_loader_app_is_non_installed, NULL);
        if (state->list == NULL) {
                g_task_return_new_error (task,
                                         GS_PLUGIN_LOADER_ERROR,


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