[gnome-software] flatpak: Set app state to INSTALLED more consistently
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] flatpak: Set app state to INSTALLED more consistently
- Date: Fri, 12 Jun 2020 15:03:34 +0000 (UTC)
commit 0b446de924a10e74c915307cbefaf176a36e866b
Author: Matthew Leeds <matthew leeds endlessm com>
Date: Mon Jan 27 12:51:18 2020 -0800
flatpak: Set app state to INSTALLED more consistently
In a couple places we were calling gs_flatpak_create_installed() but not
setting the app to AS_APP_STATE_INSTALLED. Fix that.
plugins/flatpak/gs-flatpak.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index f2d290c1..384676d0 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1104,6 +1104,8 @@ gs_flatpak_create_installed (GsFlatpak *self,
/* create new object */
origin = flatpak_installed_ref_get_origin (xref);
app = gs_flatpak_create_app (self, origin, FLATPAK_REF (xref));
+ if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN)
+ gs_app_set_state (app, AS_APP_STATE_INSTALLED);
gs_flatpak_set_metadata_installed (self, app, xref);
return g_steal_pointer (&app);
}
@@ -1125,8 +1127,6 @@ gs_flatpak_add_installed (GsFlatpak *self, GsAppList *list,
for (guint i = 0; i < xrefs->len; i++) {
FlatpakInstalledRef *xref = g_ptr_array_index (xrefs, i);
g_autoptr(GsApp) app = gs_flatpak_create_installed (self, xref);
- if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN)
- gs_app_set_state (app, AS_APP_STATE_INSTALLED);
gs_app_list_add (list, app);
}
@@ -1187,8 +1187,6 @@ gs_flatpak_add_sources (GsFlatpak *self, GsAppList *list,
flatpak_remote_get_name (xremote)) != 0)
continue;
related = gs_flatpak_create_installed (self, xref);
- if (gs_app_get_state (related) == AS_APP_STATE_UNKNOWN)
- gs_app_set_state (related, AS_APP_STATE_INSTALLED);
gs_app_add_related (app, related);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]