[gnome-software/wip/jrocha/limit-parallel-ops: 1/4] Don't recover the apps' state back to QUEUED_FOR_INSTALL



commit 796f74e3409844094b948711405874cc7cc2b0f4
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Wed Jan 17 14:45:19 2018 +0100

    Don't recover the apps' state back to QUEUED_FOR_INSTALL
    
    The AS_APP_STATE_QUEUED_FOR_INSTALL is a state that depends on usually
    temporary conditions, like not having a connection. So we shouldn't
    recover that state, otherwise, the following can happen:
    * there's no connection so an app gets queued for installation;
    * when the connection becomes available the app starts installing;
    * however if the user cancels the installation, the app will show up as
      queued for install.
    
    Thus, this patch prevents the mentioned state from being recovered.

 lib/gs-app.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index e5ceb459..3c7fbd17 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -1002,6 +1002,7 @@ gs_app_set_state_internal (GsApp *app, AsAppState state)
        switch (state) {
        case AS_APP_STATE_INSTALLING:
        case AS_APP_STATE_REMOVING:
+       case AS_APP_STATE_QUEUED_FOR_INSTALL:
                /* transient, so ignore */
                break;
        default:


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