[gnome-software/gnome-3-22] Only load native languages from the AppStream file



commit 0c293c6558014a186f9c22e668659c30256f487f
Author: Richard Hughes <richard hughsie com>
Date:   Thu Nov 3 18:52:39 2016 +0000

    Only load native languages from the AppStream file
    
    This speeds up startup by ~200ms and reduces the RSS by 12Mb.

 src/plugins/gs-flatpak.c          |    4 +++-
 src/plugins/gs-plugin-appstream.c |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 16534e2..a61e2e1 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -183,7 +183,9 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
        }
        file = g_file_new_for_path (appstream_fn);
        store = as_store_new ();
-       as_store_set_add_flags (store, AS_STORE_ADD_FLAG_USE_UNIQUE_ID);
+       as_store_set_add_flags (store,
+                               AS_STORE_ADD_FLAG_USE_UNIQUE_ID |
+                               AS_STORE_ADD_FLAG_ONLY_NATIVE_LANGS);
        if (!as_store_from_file (store, file, NULL, cancellable, error)) {
                return FALSE;
        }
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 0fbf4ad..d27a1c1 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -148,6 +148,7 @@ gs_plugin_initialize (GsPlugin *plugin)
        priv->store = as_store_new ();
        as_store_set_add_flags (priv->store,
                                AS_STORE_ADD_FLAG_USE_UNIQUE_ID |
+                               AS_STORE_ADD_FLAG_ONLY_NATIVE_LANGS |
                                AS_STORE_ADD_FLAG_USE_MERGE_HEURISTIC);
        as_store_set_watch_flags (priv->store,
                                  AS_STORE_WATCH_FLAG_ADDED |


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