summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-07-15 18:58:26 +0100
committerRichard Hughes <richard@hughsie.com>2014-07-15 18:58:26 +0100
commit84487790e3f37b4a26f9197f92ceca9c234b54d0 (patch)
treea8b1ab76ee48cd885bc5fe098dacdec47ad4f19f
parentb502fa22e04197a3ce25d0e54b617d11938fad21 (diff)
downloadappstream-glib-84487790e3f37b4a26f9197f92ceca9c234b54d0.tar.gz
Show apps with missing icons in the failed metadata
-rw-r--r--libappstream-builder/plugins/asb-plugin-desktop.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c
index 18034f1..b8a4aaf 100644
--- a/libappstream-builder/plugins/asb-plugin-desktop.c
+++ b/libappstream-builder/plugins/asb-plugin-desktop.c
@@ -104,11 +104,14 @@ asb_app_load_icon (AsbApp *app,
/* check size */
if (gdk_pixbuf_get_width (pixbuf_src) < 32 ||
gdk_pixbuf_get_height (pixbuf_src) < 32) {
- asb_app_add_veto (app,
- "icon %s was too small %ix%i",
- logfn,
- gdk_pixbuf_get_width (pixbuf_src),
- gdk_pixbuf_get_height (pixbuf_src));
+ g_set_error (error,
+ ASB_PLUGIN_ERROR,
+ ASB_PLUGIN_ERROR_FAILED,
+ "icon %s was too small %ix%i",
+ logfn,
+ gdk_pixbuf_get_width (pixbuf_src),
+ gdk_pixbuf_get_height (pixbuf_src));
+ return NULL;
}
/* does the icon not have an alpha channel */
@@ -302,6 +305,7 @@ asb_plugin_process_filename (AsbPlugin *plugin,
ASB_PACKAGE_LOG_LEVEL_DEBUG,
"using stock icon %s", key);
} else {
+ _cleanup_error_free_ GError *error_local = NULL;
/* is icon XPM or GIF */
if (g_str_has_suffix (key, ".xpm"))
@@ -312,16 +316,18 @@ asb_plugin_process_filename (AsbPlugin *plugin,
asb_app_add_veto (app, "Uses ICO icon: %s", key);
/* find icon */
- pixbuf = asb_app_find_icon (app, tmpdir, key, error);
- if (pixbuf == NULL)
- return FALSE;
-
- /* save in target directory */
- icon_filename = g_strdup_printf ("%s.png",
- as_app_get_id (AS_APP (app)));
- as_app_set_icon (AS_APP (app), icon_filename, -1);
- as_app_set_icon_kind (AS_APP (app), AS_ICON_KIND_CACHED);
- asb_app_set_pixbuf (app, pixbuf);
+ pixbuf = asb_app_find_icon (app, tmpdir, key, &error_local);
+ if (pixbuf == NULL) {
+ asb_app_add_veto (app, "Failed to use icon %s: %s",
+ key, error_local->message);
+ } else {
+ /* save in target directory */
+ icon_filename = g_strdup_printf ("%s.png",
+ as_app_get_id (AS_APP (app)));
+ as_app_set_icon (AS_APP (app), icon_filename, -1);
+ as_app_set_icon_kind (AS_APP (app), AS_ICON_KIND_CACHED);
+ asb_app_set_pixbuf (app, pixbuf);
+ }
}
}