[gnome-software] flatpak: Only change an app's state if needed, when adding updates
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] flatpak: Only change an app's state if needed, when adding updates
- Date: Tue, 18 Jun 2019 15:24:25 +0000 (UTC)
commit e2b0a08a79a0d7a26443672d0d3f07017b627ebc
Author: Joaquim Rocha <jrocha endlessm com>
Date: Fri Apr 13 11:19:09 2018 +0200
flatpak: Only change an app's state if needed, when adding updates
When adding apps with updates available, we shouldn't set the state of
the app if its state is "installing", as it can be getting updated at
that moment.
plugins/flatpak/gs-flatpak.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 2c73ff80..3360ee2b 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -1398,7 +1398,11 @@ gs_flatpak_add_updates (GsFlatpak *self, GsAppList *list,
g_clear_error (&error_local);
main_app = g_object_ref (app);
}
- gs_app_set_state (main_app, AS_APP_STATE_UPDATABLE_LIVE);
+
+ /* if for some reason the app is already getting updated, then
+ * don't change its state */
+ if (gs_app_get_state (main_app) != AS_APP_STATE_INSTALLING)
+ gs_app_set_state (main_app, AS_APP_STATE_UPDATABLE_LIVE);
/* already downloaded */
if (g_strcmp0 (commit, latest_commit) != 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]