[gnome-software/gnome-3-22] Speed up loading the overview



commit e63dd8b9b7ded2aa099d4ac2c0e1ddc429ef5b88
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 8ff1629..fb86b03 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -502,16 +502,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]