[gnome-software/1177-after-os-installation-a-software-updates-available-to-download-notification-is-shown: 3/3] packagekit: Set download size to 0 after the package is downloaded




commit a1a45c82ccc35372cbcaaeec180f7e97254d20f1
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 17 19:22:55 2021 +0100

    packagekit: Set download size to 0 after the package is downloaded
    
    Once the package is downloaded there is no additional data to be downloaded,
    thus reset the download size to zero. This is also used to recognize whether
    the application is downloaded or not.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1177

 plugins/packagekit/gs-plugin-packagekit-refresh.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit-refresh.c 
b/plugins/packagekit/gs-plugin-packagekit-refresh.c
index b77827ff3..44b3ffc24 100644
--- a/plugins/packagekit/gs-plugin-packagekit-refresh.c
+++ b/plugins/packagekit/gs-plugin-packagekit-refresh.c
@@ -102,6 +102,11 @@ _download_only (GsPlugin *plugin, GsAppList *list,
                gs_plugin_packagekit_error_convert (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 */
+               gs_app_set_size_download (app, 0);
+       }
        return TRUE;
 }
 


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