[gnome-software] trivial: Do not re-download the remote icon every time it's requested
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Do not re-download the remote icon every time it's requested
- Date: Tue, 26 Jul 2016 08:22:56 +0000 (UTC)
commit 639f507db6aba385013cdbb653684975be4652f7
Author: Richard Hughes <richard hughsie com>
Date: Tue Jul 26 09:09:45 2016 +0100
trivial: Do not re-download the remote icon every time it's requested
src/plugins/gs-plugin-icons.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-icons.c b/src/plugins/gs-plugin-icons.c
index 3490039..ec7919b 100644
--- a/src/plugins/gs-plugin-icons.c
+++ b/src/plugins/gs-plugin-icons.c
@@ -157,6 +157,10 @@ gs_plugin_icons_load_remote (GsPlugin *plugin, AsIcon *icon, GError **error)
as_icon_set_filename (icon, fn_cache);
}
+ /* already in cache */
+ if (g_file_test (as_icon_get_filename (icon), G_FILE_TEST_EXISTS))
+ return gs_plugin_icons_load_local (plugin, icon, error);
+
/* a REMOTE that's really LOCAL */
if (g_str_has_prefix (as_icon_get_url (icon), "file://")) {
as_icon_set_filename (icon, as_icon_get_url (icon) + 7);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]