[gnome-software/wip/temp/ubuntu-xenial-rebased: 155/326] Don't change app state on install/remove failure



commit b762b1de69d6ef07028bb7e52daecff1cd1443a4
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Mar 16 15:29:48 2016 +1300

    Don't change app state on install/remove failure

 src/plugins/gs-plugin-snappy.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-snappy.c b/src/plugins/gs-plugin-snappy.c
index a526a8c..7037b75 100644
--- a/src/plugins/gs-plugin-snappy.c
+++ b/src/plugins/gs-plugin-snappy.c
@@ -459,7 +459,10 @@ gs_plugin_app_install (GsPlugin *plugin,
 
        gs_app_set_state (app, AS_APP_STATE_INSTALLING);
        result = send_package_action (plugin, gs_app_get_id (app), "install", error);
-       gs_app_set_state (app, AS_APP_STATE_INSTALLED);
+       if (result)
+               gs_app_set_state (app, AS_APP_STATE_INSTALLED);
+       else
+               gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
 
        return result;
 }
@@ -478,7 +481,10 @@ gs_plugin_app_remove (GsPlugin *plugin,
 
        gs_app_set_state (app, AS_APP_STATE_REMOVING);
        result = send_package_action (plugin, gs_app_get_id (app), "remove", error);
-       gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
+       if (result)
+               gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
+       else
+               gs_app_set_state (app, AS_APP_STATE_INSTALLED);
 
        return result;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]