diff options
author | Richard Hughes <richard@hughsie.com> | 2014-09-26 13:33:07 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-09-26 14:43:22 +0100 |
commit | 0fae8412cf186843fc2141dfce3336bb90badefa (patch) | |
tree | 8909131a8996a7e1983967d56c5e1c9c390c30ab /libappstream-builder/plugins/asb-plugin-desktop.c | |
parent | e38e845e39cac5501ab26c4ef13ec9751a671abd (diff) | |
download | appstream-glib-0fae8412cf186843fc2141dfce3336bb90badefa.tar.gz |
trivial: Do the ICO,GIF,XPM check after the icon has been found
Icons shipped as gimp.xpm and referenced as 'gimp' should be detected.
Diffstat (limited to 'libappstream-builder/plugins/asb-plugin-desktop.c')
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-desktop.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c index 759a673..c4d4369 100644 --- a/libappstream-builder/plugins/asb-plugin-desktop.c +++ b/libappstream-builder/plugins/asb-plugin-desktop.c @@ -214,6 +214,20 @@ asb_plugin_desktop_add_icons (AsbPlugin *plugin, return; } + /* is icon in a unsupported format */ + if (g_str_has_suffix (fn, ".xpm")) { + as_app_add_veto (AS_APP (app), "Uses XPM icon: %s", something); + return; + } + if (g_str_has_suffix (fn, ".gif")) { + as_app_add_veto (AS_APP (app), "Uses GIF icon: %s", something); + return; + } + if (g_str_has_suffix (fn, ".ico")) { + as_app_add_veto (AS_APP (app), "Uses ICO icon: %s", something); + return; + } + /* load the icon */ pixbuf = asb_app_load_icon (plugin, app, fn, fn + strlen (tmpdir), @@ -307,17 +321,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")) - as_app_add_veto (AS_APP (app), "Uses XPM icon: %s", key); - else if (g_str_has_suffix (key, ".gif")) - as_app_add_veto (AS_APP (app), "Uses GIF icon: %s", key); - else if (g_str_has_suffix (key, ".ico")) - as_app_add_veto (AS_APP (app), "Uses ICO icon: %s", key); - else - asb_plugin_desktop_add_icons (plugin, app, tmpdir, key); + asb_plugin_desktop_add_icons (plugin, app, tmpdir, key); } } |