[gnome-software/wip/jrocha/fix-runtime-extensions-update: 17/20] flatpak: Refine extensions when getting them
- From: Joaquim Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/jrocha/fix-runtime-extensions-update: 17/20] flatpak: Refine extensions when getting them
- Date: Tue, 30 Jan 2018 19:35:32 +0000 (UTC)
commit fda58e8638a2d9f6bfe7a50562e3867615b75511
Author: Joaquim Rocha <jrocha endlessm com>
Date: Mon Nov 6 14:26:26 2017 +0100
flatpak: Refine extensions when getting them
When installing or removing an app, a list with the app's related
extensions is gathered in order to install/remove them as well.
The lists in this app may not have the correct state assigned when
they're gathered though, so when installing/removing them, there will
be a warning about an unexpected change of state.
These changes refine the mentioned extensions meaning they will set up
the right state and allow the further state changes from further
operations (installation/removal).
plugins/flatpak/gs-flatpak.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index a34eaf27..47e8ec33 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -2328,10 +2328,13 @@ gs_flatpak_get_list_for_remove (GsFlatpak *self, GsApp *app,
for (guint i = 0; i < related->len; i++) {
FlatpakRelatedRef *xref_related = g_ptr_array_index (related, i);
g_autoptr(GsApp) app_tmp = NULL;
+
if (!flatpak_related_ref_should_delete (xref_related))
continue;
app_tmp = gs_flatpak_create_app (self, FLATPAK_REF (xref_related));
gs_app_set_origin (app_tmp, gs_app_get_origin (app));
+ if (!gs_plugin_refine_item_state (self, app_tmp, cancellable, error))
+ return NULL;
gs_app_list_add (list, app_tmp);
}
@@ -2518,6 +2521,10 @@ gs_flatpak_get_list_for_install (GsFlatpak *self, GsApp *app,
} else {
gs_app_set_origin (app_tmp, gs_app_get_origin (app));
g_debug ("adding related %s for install", ref_display);
+
+ if (!gs_plugin_refine_item_state (self, app_tmp, cancellable, error))
+ return NULL;
+
gs_app_list_add (list, app_tmp);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]