[gnome-software/wip/hughsie/steam] Only download remote icons if not already in the icon cache



commit ff703357746776489cc5670f3b6423283ca516e4
Author: Richard Hughes <richard hughsie com>
Date:   Fri Oct 2 09:36:08 2015 +0100

    Only download remote icons if not already in the icon cache

 src/plugins/gs-plugin-icons.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/gs-plugin-icons.c b/src/plugins/gs-plugin-icons.c
index 8055b82..d92d30f 100644
--- a/src/plugins/gs-plugin-icons.c
+++ b/src/plugins/gs-plugin-icons.c
@@ -180,10 +180,12 @@ gs_plugin_refine_app (GsPlugin *plugin, GsApp *app, GError **error)
                memcpy (found, ".png", 4);
 
        /* create runtime dir and download */
-       if (!gs_mkdir_parent (fn, error))
-               return FALSE;
-       if (!gs_plugin_icons_download (plugin, as_icon_get_url (ic), fn, error))
-               return FALSE;
+       if (!g_file_test (fn, G_FILE_TEST_EXISTS)) {
+               if (!gs_mkdir_parent (fn, error))
+                       return FALSE;
+               if (!gs_plugin_icons_download (plugin, as_icon_get_url (ic), fn, error))
+                       return FALSE;
+       }
        as_icon_set_kind (ic, AS_ICON_KIND_LOCAL);
        return gs_app_load_icon (app, plugin->scale, error);
 }


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