[gnome-software] packagekit refine: Break out a function
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] packagekit refine: Break out a function
- Date: Thu, 1 Mar 2018 10:12:40 +0000 (UTC)
commit 716107365947a734938605ec9aca0e5c0bcbce5a
Author: Kalev Lember <klember redhat com>
Date: Thu Mar 1 10:13:47 2018 +0100
packagekit refine: Break out a function
plugins/packagekit/gs-plugin-packagekit-refine.c | 33 ++++++++++++++++++++----
1 file changed, 28 insertions(+), 5 deletions(-)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit-refine.c
b/plugins/packagekit/gs-plugin-packagekit-refine.c
index c6c00d7f..bb5fb740 100644
--- a/plugins/packagekit/gs-plugin-packagekit-refine.c
+++ b/plugins/packagekit/gs-plugin-packagekit-refine.c
@@ -85,10 +85,11 @@ gs_plugin_adopt_app (GsPlugin *plugin, GsApp *app)
}
static gboolean
-gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
- GsAppList *list,
- GCancellable *cancellable,
- GError **error)
+gs_plugin_packagekit_resolve_packages_with_filter (GsPlugin *plugin,
+ GsAppList *list,
+ PkBitfield filter,
+ GCancellable *cancellable,
+ GError **error)
{
GsPluginData *priv = gs_plugin_get_data (plugin);
GPtrArray *sources;
@@ -124,7 +125,7 @@ gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
/* resolve them all at once */
results = pk_client_resolve (priv->client,
- pk_bitfield_from_enums (PK_FILTER_ENUM_NEWEST, PK_FILTER_ENUM_ARCH, -1),
+ filter,
(gchar **) package_ids->pdata,
cancellable,
gs_plugin_packagekit_progress_cb, &data,
@@ -153,6 +154,28 @@ gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
return TRUE;
}
+static gboolean
+gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
+ GsAppList *list,
+ GCancellable *cancellable,
+ GError **error)
+{
+ PkBitfield filter;
+
+ filter = pk_bitfield_from_enums (PK_FILTER_ENUM_NEWEST,
+ PK_FILTER_ENUM_ARCH,
+ -1);
+ if (!gs_plugin_packagekit_resolve_packages_with_filter (plugin,
+ list,
+ filter,
+ cancellable,
+ error)) {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
static gboolean
gs_plugin_packagekit_refine_from_desktop (GsPlugin *plugin,
GsApp *app,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]