From 4da56c8c62980f979ef55887282ffa48223207ea Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 19 Apr 2018 10:26:26 +0200 Subject: [PATCH] RemoteState: Drop cancallable from flatpak_remote_state_lookup_cache() This is a no-i/o operation on immutable data, there is no need for a cancellable. Closes: #1594 Approved by: alexlarsson --- app/flatpak-builtins-ls-remote.c | 2 +- app/flatpak-transaction.c | 2 +- common/flatpak-dir.c | 3 +-- common/flatpak-dir.h | 1 - lib/flatpak-installation.c | 4 ++-- lib/flatpak-remote-ref.c | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/flatpak-builtins-ls-remote.c b/app/flatpak-builtins-ls-remote.c index 01d9639f..f2272c37 100644 --- a/app/flatpak-builtins-ls-remote.c +++ b/app/flatpak-builtins-ls-remote.c @@ -328,7 +328,7 @@ flatpak_builtin_ls_remote (int argc, char **argv, GCancellable *cancellable, GEr if (!flatpak_remote_state_lookup_cache (state, ref, &download_size, &installed_size, NULL, - NULL, error)) + error)) return FALSE; /* The sparse cache is optional */ diff --git a/app/flatpak-transaction.c b/app/flatpak-transaction.c index f44ee8d3..03d7f589 100644 --- a/app/flatpak-transaction.c +++ b/app/flatpak-transaction.c @@ -564,7 +564,7 @@ flatpak_transaction_add_ref (FlatpakTransaction *self, if (metadata == NULL && remote != NULL) { - if (!flatpak_remote_state_lookup_cache (state, ref, NULL, NULL, &metadata, NULL, &local_error)) + if (!flatpak_remote_state_lookup_cache (state, ref, NULL, NULL, &metadata, &local_error)) { g_print (_("Warning: Can't find dependencies: %s\n"), local_error->message); g_clear_error (&local_error); diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 53d21f7e..ebd5579d 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -303,7 +303,6 @@ flatpak_remote_state_lookup_cache (FlatpakRemoteState *self, guint64 *download_size, guint64 *installed_size, const char **metadata, - GCancellable *cancellable, GError **error) { g_autoptr(GVariant) cache_v = NULL; @@ -10799,7 +10798,7 @@ flatpak_dir_find_remote_related (FlatpakDir *self, if (flatpak_remote_state_lookup_cache (state, ref, NULL, NULL, &metadata, - NULL, NULL) && + NULL) && g_key_file_load_from_data (metakey, metadata, -1, 0, NULL)) { g_auto(GStrv) groups = NULL; diff --git a/common/flatpak-dir.h b/common/flatpak-dir.h index 0111ad9b..354a8489 100644 --- a/common/flatpak-dir.h +++ b/common/flatpak-dir.h @@ -115,7 +115,6 @@ gboolean flatpak_remote_state_lookup_cache (FlatpakRemoteState *self, guint64 *download_size, guint64 *installed_size, const char **metadata, - GCancellable *cancellable, GError **error); GVariant *flatpak_remote_state_lookup_sparse_cache (FlatpakRemoteState *self, const char *ref, diff --git a/lib/flatpak-installation.c b/lib/flatpak-installation.c index d0441f8a..5d1a2a48 100644 --- a/lib/flatpak-installation.c +++ b/lib/flatpak-installation.c @@ -2047,7 +2047,7 @@ flatpak_installation_fetch_remote_size_sync (FlatpakInstallation *self, return flatpak_remote_state_lookup_cache (state, full_ref, download_size, installed_size, NULL, - cancellable, error); + error); } /** @@ -2088,7 +2088,7 @@ flatpak_installation_fetch_remote_metadata_sync (FlatpakInstallation *self, if (!flatpak_remote_state_lookup_cache (state, full_ref, NULL, NULL, &res, - cancellable, error)) + error)) return NULL; return g_bytes_new (res, strlen (res)); diff --git a/lib/flatpak-remote-ref.c b/lib/flatpak-remote-ref.c index 929156b2..eaa24cee 100644 --- a/lib/flatpak-remote-ref.c +++ b/lib/flatpak-remote-ref.c @@ -338,7 +338,7 @@ flatpak_remote_ref_new (FlatpakCollectionRef *coll_ref, if (state && !flatpak_remote_state_lookup_cache (state, full_ref, &download_size, &installed_size, &metadata, - NULL, NULL)) + NULL)) { g_warning ("Ignoring ref %s due to lack of metadata", full_ref); return NULL;