diff options
author | Richard Hughes <richard@hughsie.com> | 2017-06-07 13:40:13 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-06-07 13:40:26 +0100 |
commit | b5b4a855acb5c0a5b64e12d3a280309117fb7864 (patch) | |
tree | 238cedd6a8e96b4ac4c8fa551d4cc42846365134 /libappstream-builder/plugins/asb-plugin-appdata.c | |
parent | fa2fa8d6c53155db4a11e848f6dc93d8f47617c8 (diff) | |
download | appstream-glib-b5b4a855acb5c0a5b64e12d3a280309117fb7864.tar.gz |
Do not add the GNOME-Software-specific categories or icons by default
This is better done client side. Add a build flag so we can still build metadata
for old versions of Fedora.
Diffstat (limited to 'libappstream-builder/plugins/asb-plugin-appdata.c')
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-appdata.c | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-appdata.c b/libappstream-builder/plugins/asb-plugin-appdata.c index 20ec53a..b2e7fb1 100644 --- a/libappstream-builder/plugins/asb-plugin-appdata.c +++ b/libappstream-builder/plugins/asb-plugin-appdata.c @@ -155,35 +155,39 @@ asb_plugin_process_filename (AsbPlugin *plugin, "Upstream contact <%s>", tmp); } - /* add icon for firmware */ - if (as_app_get_kind (AS_APP (app)) == AS_APP_KIND_FIRMWARE) { - g_autoptr(AsIcon) icon = NULL; - icon = as_icon_new (); - as_icon_set_kind (icon, AS_ICON_KIND_STOCK); - as_icon_set_name (icon, "application-x-executable"); - as_app_add_icon (AS_APP (app), icon); - } + /* fix up various components as required */ + if (asb_context_get_flag (plugin->ctx, ASB_CONTEXT_FLAG_ADD_DEFAULT_ICONS)) { - /* fix up input methods */ - if (as_app_get_kind (AS_APP (app)) == AS_APP_KIND_INPUT_METHOD) { - g_autoptr(AsIcon) icon = NULL; - icon = as_icon_new (); - as_icon_set_kind (icon, AS_ICON_KIND_STOCK); - as_icon_set_name (icon, "system-run-symbolic"); - as_app_add_icon (AS_APP (app), icon); - as_app_add_category (AS_APP (app), "Addons"); - as_app_add_category (AS_APP (app), "InputSources"); - } + /* add icon for firmware */ + if (as_app_get_kind (AS_APP (app)) == AS_APP_KIND_FIRMWARE) { + g_autoptr(AsIcon) icon = NULL; + icon = as_icon_new (); + as_icon_set_kind (icon, AS_ICON_KIND_STOCK); + as_icon_set_name (icon, "application-x-executable"); + as_app_add_icon (AS_APP (app), icon); + } - /* fix up codecs */ - if (as_app_get_kind (AS_APP (app)) == AS_APP_KIND_CODEC) { - g_autoptr(AsIcon) icon = NULL; - icon = as_icon_new (); - as_icon_set_kind (icon, AS_ICON_KIND_STOCK); - as_icon_set_name (icon, "application-x-addon"); - as_app_add_icon (AS_APP (app), icon); - as_app_add_category (AS_APP (app), "Addons"); - as_app_add_category (AS_APP (app), "Codecs"); + /* fix up input methods */ + if (as_app_get_kind (AS_APP (app)) == AS_APP_KIND_INPUT_METHOD) { + g_autoptr(AsIcon) icon = NULL; + icon = as_icon_new (); + as_icon_set_kind (icon, AS_ICON_KIND_STOCK); + as_icon_set_name (icon, "system-run-symbolic"); + as_app_add_icon (AS_APP (app), icon); + as_app_add_category (AS_APP (app), "Addons"); + as_app_add_category (AS_APP (app), "InputSources"); + } + + /* fix up codecs */ + if (as_app_get_kind (AS_APP (app)) == AS_APP_KIND_CODEC) { + g_autoptr(AsIcon) icon = NULL; + icon = as_icon_new (); + as_icon_set_kind (icon, AS_ICON_KIND_STOCK); + as_icon_set_name (icon, "application-x-addon"); + as_app_add_icon (AS_APP (app), icon); + as_app_add_category (AS_APP (app), "Addons"); + as_app_add_category (AS_APP (app), "Codecs"); + } } /* success */ |