[gnome-software/wip/kalev/gnome-3-22-prep: 34/52] Filter apps that are not updatable from the updates list



commit 60c9cf3bbcb157683154f80be97f29a84d17ac50
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Tue Oct 18 18:20:29 2016 +0200

    Filter apps that are not updatable from the updates list
    
    When the list of updates is gathered and filtered, it should also
    check for apps that are not in an updatable state.
    
    (cherry picked from commit e76d1c823d2031b6e8dfc91d0f60a7a622a5eb71)

 src/gs-plugin-loader.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index a84492f..37d4953 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -891,6 +891,13 @@ gs_plugin_loader_app_is_valid (GsApp *app, gpointer user_data)
 }
 
 static gboolean
+gs_plugin_loader_app_is_valid_updatable (GsApp *app, gpointer user_data)
+{
+       return gs_plugin_loader_app_is_valid (app, user_data) &&
+               gs_app_is_updatable (app);
+}
+
+static gboolean
 gs_plugin_loader_filter_qt_for_gtk (GsApp *app, gpointer user_data)
 {
        /* hide the QT versions in preference to the GTK ones */
@@ -1157,9 +1164,9 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
                return;
        }
 
-       /* remove any packages that are not proper applications or
-        * OS updates */
-       gs_app_list_filter (state->list, gs_plugin_loader_app_is_valid, state);
+       /* remove any apps that are not proper applications or OS updates */
+       gs_app_list_filter (state->list,
+                           gs_plugin_loader_app_is_valid_updatable, state);
 
        /* filter duplicates with priority */
        gs_app_list_filter (state->list, gs_plugin_loader_app_set_prio, plugin_loader);


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