[gnome-software/1266-indeterminate-progress-bar-for-os-updates] packagekit: Check the cancellable on finished download



commit 242b5217671cdeaa65372ad7eaa170562456ea23
Author: Milan Crha <mcrha redhat com>
Date:   Wed Oct 13 15:59:26 2021 +0200

    packagekit: Check the cancellable on finished download
    
    The result of the pk_task_update_packages_sync() can be non-NULL when
    the operation had been cancelled, thus check the cancellable, to not
    set all apps as downloaded when they are not.

 plugins/packagekit/gs-plugin-packagekit-refresh.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit-refresh.c 
b/plugins/packagekit/gs-plugin-packagekit-refresh.c
index 513b52169..9a6592171 100644
--- a/plugins/packagekit/gs-plugin-packagekit-refresh.c
+++ b/plugins/packagekit/gs-plugin-packagekit-refresh.c
@@ -128,6 +128,8 @@ _download_only (GsPluginPackagekitRefresh  *self,
                gs_plugin_packagekit_error_convert (error);
                return FALSE;
        }
+       if (g_cancellable_set_error_if_cancelled (cancellable, error))
+               return FALSE;
        for (guint i = 0; i < gs_app_list_length (list); i++) {
                GsApp *app = gs_app_list_index (list, i);
                /* To indicate the app is already downloaded */


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