[gnome-software] Update only related apps of a proxy if they are updatable
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Update only related apps of a proxy if they are updatable
- Date: Thu, 15 Dec 2016 11:18:54 +0000 (UTC)
commit d261bce0ba2012e3d3a02762013711cd1907fff6
Author: Joaquim Rocha <jrocha endlessm com>
Date: Wed Dec 14 21:06:17 2016 +0100
Update only related apps of a proxy if they are updatable
src/gs-plugin-loader.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index c47fa0a..eb392c6 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -4343,6 +4343,20 @@ gs_plugin_loader_file_to_app_finish (GsPluginLoader *plugin_loader,
/******************************************************************************/
+static GPtrArray *
+get_updatable_apps (GPtrArray *apps)
+{
+ GPtrArray *updatables = g_ptr_array_sized_new (apps->len);
+
+ for (guint i = 0; i < apps->len; ++i) {
+ GsApp *app = g_ptr_array_index (apps, i);
+ if (gs_app_is_updatable (app))
+ g_ptr_array_add (updatables, app);
+ }
+
+ return updatables;
+}
+
static void
gs_plugin_loader_update_thread_cb (GTask *task,
gpointer object,
@@ -4389,7 +4403,7 @@ gs_plugin_loader_update_thread_cb (GTask *task,
/* operate on the parent app or the related apps */
if (gs_app_has_quirk (app_tmp, AS_APP_QUIRK_IS_PROXY)) {
- apps = g_ptr_array_ref (gs_app_get_related (app_tmp));
+ apps = get_updatable_apps (gs_app_get_related (app_tmp));
} else {
apps = g_ptr_array_new ();
g_ptr_array_add (apps, app_tmp);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]