[gnome-software] Speed up loading the overview



commit 3aaf2833dd585f5aa6b618eb72f7c9b099f66e60
Author: Richard Hughes <richard hughsie com>
Date:   Wed Sep 14 12:49:28 2016 +0100

    Speed up loading the overview
    
    Don't rely on PackageKit to just ask if things are already installed, instead
    use the information we have already in the AsApp.

 src/plugins/gs-appstream.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/src/plugins/gs-appstream.c b/src/plugins/gs-appstream.c
index 87789f3..90d271d 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -520,16 +520,9 @@ gs_appstream_refine_app (GsPlugin *plugin,
        }
 
        /* is installed already */
-       if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN) {
-               switch (as_app_get_source_kind (item)) {
-               case AS_APP_SOURCE_KIND_APPDATA:
-               case AS_APP_SOURCE_KIND_DESKTOP:
-               case AS_APP_SOURCE_KIND_METAINFO:
-                       gs_app_set_state (app, AS_APP_STATE_INSTALLED);
-                       break;
-               default:
-                       break;
-               }
+       if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN &&
+           as_app_get_state (item) != AS_APP_STATE_UNKNOWN) {
+               gs_app_set_state (app, as_app_get_state (item));
        }
 
        /* types we can never launch */


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