[gnome-software] flatpak: Don't inadvertently change update states when adding sources



commit d08000a96a8c8899fa42ef16ed4dee1b5591c2c1
Author: Kalev Lember <klember redhat com>
Date:   Tue Feb 20 11:54:40 2018 +0100

    flatpak: Don't inadvertently change update states when adding sources
    
    When adding related apps for sources, avoid updating their state when
    they already have a state set. This fixes state change warnings when
    opening the repos dialog:
    
    State change on system/flatpak/flathub/desktop/org.gnome.Recipes.desktop/stable from updatable-live to 
installed is not OK

 plugins/flatpak/gs-flatpak.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index fd70a3d0..97f42ea0 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -944,7 +944,8 @@ gs_flatpak_add_sources (GsFlatpak *self, GsAppList *list,
                                           error_local->message);
                                continue;
                        }
-                       gs_app_set_state (related, AS_APP_STATE_INSTALLED);
+                       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]