[gnome-software/wip/hughsie/fwupd] Set the app state correctly when installing firmware



commit 4409510b6a8bfae8c31ea2eabf75c46721343b22
Author: Richard Hughes <richard hughsie com>
Date:   Thu Mar 12 13:41:11 2015 +0000

    Set the app state correctly when installing firmware

 src/plugins/gs-plugin-fwupd.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/src/plugins/gs-plugin-fwupd.c b/src/plugins/gs-plugin-fwupd.c
index a9e441b..1fef812 100644
--- a/src/plugins/gs-plugin-fwupd.c
+++ b/src/plugins/gs-plugin-fwupd.c
@@ -546,11 +546,12 @@ gs_plugin_app_upgrade (GsPlugin *plugin,
                             filename, device_id);
                return FALSE;
        }
-       return gs_plugin_fwupd_upgrade (plugin,
-                                       filename,
-                                       device_id,
-                                       cancellable,
-                                       error);
+       gs_app_set_state (app, AS_APP_STATE_INSTALLING);
+       if (!gs_plugin_fwupd_upgrade (plugin, filename, device_id,
+                                     cancellable, error))
+               return FALSE;
+       gs_app_set_state (app, AS_APP_STATE_INSTALLED);
+       return TRUE;
 }
 
 /**
@@ -573,11 +574,11 @@ gs_plugin_app_install (GsPlugin *plugin,
                             filename);
                return FALSE;
        }
-       return gs_plugin_fwupd_upgrade (plugin,
-                                       filename,
-                                       "*",
-                                       cancellable,
-                                       error);
+       gs_app_set_state (app, AS_APP_STATE_INSTALLING);
+       if (!gs_plugin_fwupd_upgrade (plugin, filename, "*", cancellable, error))
+               return FALSE;
+       gs_app_set_state (app, AS_APP_STATE_INSTALLED);
+       return TRUE;
 }
 
 /**


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