[gnome-software/wip/gs-plugin-appstream-ignore-refine-with-no-id: 89/90] packagekit: Set cached app state, if unknown, when getting updates




commit 0f28bb349aa3d6c45e1a28752dd2b4751789213e
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jul 20 13:12:07 2022 +0200

    packagekit: Set cached app state, if unknown, when getting updates
    
    The app's state is known when getting packages for update, thus reflect
    that also for already cached apps, not only for the non-cached apps.

 plugins/packagekit/gs-plugin-packagekit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit.c b/plugins/packagekit/gs-plugin-packagekit.c
index 79347f350..58d627276 100644
--- a/plugins/packagekit/gs-plugin-packagekit.c
+++ b/plugins/packagekit/gs-plugin-packagekit.c
@@ -723,8 +723,11 @@ static GsApp *
 gs_plugin_packagekit_build_update_app (GsPlugin *plugin, PkPackage *package)
 {
        GsApp *app = gs_plugin_cache_lookup (plugin, pk_package_get_id (package));
-       if (app != NULL)
+       if (app != NULL) {
+               if (gs_app_get_state (app) == GS_APP_STATE_UNKNOWN)
+                       gs_app_set_state (app, GS_APP_STATE_UPDATABLE);
                return app;
+       }
        app = gs_app_new (NULL);
        gs_plugin_packagekit_set_packaging_format (plugin, app);
        gs_app_add_source (app, pk_package_get_name (package));


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