[gnome-software/wip/kalev/unbreak-offline-updates: 1/5] plugin loader: Store the current app state instead of guessing



commit ddbcd1761647cb1261e5489f1f526fdc13b6196a
Author: Kalev Lember <kalevlember gmail com>
Date:   Fri May 29 23:57:03 2015 +0200

    plugin loader: Store the current app state instead of guessing
    
    When saving the state to revert back in case of failure, don't try to
    guess the appropriate state but instead just save the current value
    returned by gs_app_get_state().

 src/gs-plugin-loader.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 663c369..e44542f 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2571,12 +2571,12 @@ gs_plugin_loader_app_action_async (GsPluginLoader *plugin_loader,
        case GS_PLUGIN_LOADER_ACTION_INSTALL:
                state->function_name = "gs_plugin_app_install";
                state->state_success = AS_APP_STATE_INSTALLED;
-               state->state_failure = AS_APP_STATE_AVAILABLE;
+               state->state_failure = gs_app_get_state (app);
                break;
        case GS_PLUGIN_LOADER_ACTION_REMOVE:
                state->function_name = "gs_plugin_app_remove";
                state->state_success = AS_APP_STATE_AVAILABLE;
-               state->state_failure = AS_APP_STATE_INSTALLED;
+               state->state_failure = gs_app_get_state (app);
                break;
        case GS_PLUGIN_LOADER_ACTION_SET_RATING:
                state->function_name = "gs_plugin_app_set_rating";


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