[gnome-software] Do not search for missing pixbufs to fix-up broken metadata
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Do not search for missing pixbufs to fix-up broken metadata
- Date: Mon, 7 Jul 2014 13:50:24 +0000 (UTC)
commit cf79edece86d4502eb5c87cf2d32060ac81de448
Author: Richard Hughes <richard hughsie com>
Date: Mon Jul 7 14:49:45 2014 +0100
Do not search for missing pixbufs to fix-up broken metadata
Distros have had nearly 2 years to fix things up.
src/plugins/gs-plugin-appstream.c | 64 ++-----------------------------------
1 files changed, 3 insertions(+), 61 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 7a2f02b..0650c29 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -178,49 +178,6 @@ out:
}
/**
- * gs_plugin_refine_search_pixbuf:
- *
- * This method allows us to cope with metadata like this:
- *
- * <icon type="local">gnome-chess</icon>
- * <icon type="local">geary</icon>
- *
- * Where .../app-info/icons/gnome-chess.png and .../app-info/icons/geary.svg
- * exist.
- *
- * Basically, we have to stick on the extension and stat() each file in turn.
- */
-static gchar *
-gs_plugin_refine_search_pixbuf (GsPlugin *plugin,
- const gchar *icon_dir,
- const gchar *icon)
-{
- const gchar *exensions[] = { "png",
- "svg",
- "svgz",
- "gif",
- "ico",
- "xcf",
- NULL };
- gchar *icon_path;
- guint i;
-
- /* exists */
- for (i = 0; exensions[i] != NULL; i++) {
- icon_path = g_strdup_printf ("%s/%s.%s",
- icon_dir,
- icon,
- exensions[i]);
- if (g_file_test (icon_path, G_FILE_TEST_EXISTS))
- goto out;
- g_free (icon_path);
- icon_path = NULL;
- }
-out:
- return icon_path;
-}
-
-/**
* gs_plugin_refine_item_pixbuf:
*/
static void
@@ -255,24 +212,9 @@ gs_plugin_refine_item_pixbuf (GsPlugin *plugin, GsApp *app, AsApp *item)
gs_app_set_icon (app, icon_path);
ret = gs_app_load_icon (app, &error);
if (!ret) {
- g_warning ("falling back to searching for %s", icon_path);
- g_clear_error (&error);
- g_free (icon_path);
-
- /* we are not going to be doing this forever,
- * SO FIX YOUR APPSTREAM METADATA */
- icon_path = gs_plugin_refine_search_pixbuf (plugin, icon_dir, icon);
- if (icon_path == NULL) {
- g_warning ("failed to load cached icon %s", icon);
- goto out;
- }
- gs_app_set_icon (app, icon_path);
- ret = gs_app_load_icon (app, &error);
- if (!ret) {
- g_warning ("failed to load cached icon %s: %s",
- icon, error->message);
- g_error_free (error);
- }
+ g_warning ("failed to load cached icon %s: %s",
+ icon, error->message);
+ g_error_free (error);
goto out;
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]