[gnome-software] trivial: Do not re-fetch the flatpak updates download size if already set
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Do not re-fetch the flatpak updates download size if already set
- Date: Thu, 3 Nov 2016 20:29:10 +0000 (UTC)
commit acbce098c8fab081b982c8692a6bddae95ea03eb
Author: Richard Hughes <richard hughsie com>
Date: Thu Nov 3 20:28:27 2016 +0000
trivial: Do not re-fetch the flatpak updates download size if already set
src/plugins/gs-flatpak.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 32b8ae3..3f871a4 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -1017,18 +1017,20 @@ gs_flatpak_add_updates_pending (GsFlatpak *self, GsAppList *list,
gs_app_set_state (app, AS_APP_STATE_UPDATABLE_LIVE);
/* get the current download size */
- if (!flatpak_installation_fetch_remote_size_sync (self->installation,
- gs_app_get_origin (app),
- FLATPAK_REF (xref),
- &download_size,
- NULL,
- cancellable,
- &error_local)) {
- g_warning ("failed to get download size: %s",
- error_local->message);
- gs_app_set_size_download (app, GS_APP_SIZE_UNKNOWABLE);
- } else {
- gs_app_set_size_download (app, download_size);
+ if (gs_app_get_size_download (app) == 0) {
+ if (!flatpak_installation_fetch_remote_size_sync (self->installation,
+ gs_app_get_origin (app),
+ FLATPAK_REF (xref),
+ &download_size,
+ NULL,
+ cancellable,
+ &error_local)) {
+ g_warning ("failed to get download size: %s",
+ error_local->message);
+ gs_app_set_size_download (app, GS_APP_SIZE_UNKNOWABLE);
+ } else {
+ gs_app_set_size_download (app, download_size);
+ }
}
gs_app_list_add (list, app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]