[gnome-software/wip/iainl/ubuntu-xenial: 43/56] Don't change app state on install/remove failure



commit acbb31809491ec03a5336eb9454efb6fc9e72004
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 e5aa468..0168ab8 100644
--- a/src/plugins/gs-plugin-snappy.c
+++ b/src/plugins/gs-plugin-snappy.c
@@ -458,7 +458,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;
 }
@@ -477,7 +480,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]