[gnome-software] Do not call PackageKit.GetPackages() at startup
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Do not call PackageKit.GetPackages() at startup
- Date: Tue, 24 May 2016 12:49:33 +0000 (UTC)
commit 1b1e4fd2d02c369b8f7570f64b60790f2726efa4
Author: Richard Hughes <richard hughsie com>
Date: Tue May 24 13:28:59 2016 +0100
Do not call PackageKit.GetPackages() at startup
We get the application list from AsStore in the appstream plugin, and I can't
think what using GetPackages is adding that AsStore is unaware of.
Although we might have to refine() a lot of applications manually for the app
version it does mean that we don't end up refine()-ing the AppStream-generated
GsApp *and* dropping the PackageKit-generated GsApp on the floor, completely
unused.
This wasn't such a big problem when we were subsuming applications from
multiple plugins, but now it is as the GsAppList object notifies us about each
unused duplicate.
src/plugins/gs-plugin-packagekit.c | 37 ------------------------------------
1 files changed, 0 insertions(+), 37 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit.c b/src/plugins/gs-plugin-packagekit.c
index 8aa9efd..c6dec89 100644
--- a/src/plugins/gs-plugin-packagekit.c
+++ b/src/plugins/gs-plugin-packagekit.c
@@ -98,43 +98,6 @@ gs_plugin_packagekit_progress_cb (PkProgress *progress,
}
}
-gboolean
-gs_plugin_add_installed (GsPlugin *plugin,
- GsAppList *list,
- GCancellable *cancellable,
- GError **error)
-{
- GsPluginData *priv = gs_plugin_get_data (plugin);
- PkBitfield filter;
- ProgressData data;
- g_autoptr(PkResults) results = NULL;
-
- data.app = NULL;
- data.plugin = plugin;
- data.ptask = NULL;
-
- /* update UI as this might take some time */
- gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_WAITING);
-
- /* do sync call */
- filter = pk_bitfield_from_enums (PK_FILTER_ENUM_INSTALLED,
- PK_FILTER_ENUM_NEWEST,
- PK_FILTER_ENUM_ARCH,
- PK_FILTER_ENUM_APPLICATION,
- PK_FILTER_ENUM_NOT_COLLECTIONS,
- -1);
- results = pk_client_get_packages (PK_CLIENT(priv->task),
- filter,
- cancellable,
- gs_plugin_packagekit_progress_cb, &data,
- error);
- if (!gs_plugin_packagekit_results_valid (results, error))
- return FALSE;
-
- /* add results */
- return gs_plugin_packagekit_add_results (plugin, list, results, error);
-}
-
static gboolean
gs_plugin_add_sources_related (GsPlugin *plugin,
GHashTable *hash,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]