[gnome-software] packagekit: Move to installing state earlier



commit a179c17a4fbfdb415882221c77a1aec3d287c1d9
Author: Kalev Lember <klember redhat com>
Date:   Fri Mar 2 08:48:29 2018 +0100

    packagekit: Move to installing state earlier
    
    When installing unavailable packages and enabling a repo, we have (for
    reasons unknown to me) a 3 second sleep before calling into PK again to
    install the package. This commit moves the state change earlier so that
    we can show in the UI that we've moved on to installing while still in
    the 3 second delay.

 plugins/packagekit/gs-plugin-packagekit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit.c b/plugins/packagekit/gs-plugin-packagekit.c
index 51ec33e5..f10f8dc9 100644
--- a/plugins/packagekit/gs-plugin-packagekit.c
+++ b/plugins/packagekit/gs-plugin-packagekit.c
@@ -301,13 +301,14 @@ gs_plugin_app_install (GsPlugin *plugin,
                if (!gs_plugin_app_origin_repo_enable (plugin, app, cancellable, error))
                        return FALSE;
 
+               gs_app_set_state (app, AS_APP_STATE_INSTALLING);
+
                /* FIXME: this is a hack, to allow PK time to re-initialize
                 * everything in order to match an actual result. The root cause
                 * is probably some kind of hard-to-debug race in the daemon. */
                g_usleep (G_USEC_PER_SEC * 3);
 
                /* actually install the package */
-               gs_app_set_state (app, AS_APP_STATE_INSTALLING);
                results = pk_task_install_packages_sync (priv->task,
                                                         package_ids,
                                                         cancellable,


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