diff options
author | Richard Hughes <richard@hughsie.com> | 2018-05-25 14:48:52 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2018-05-25 15:14:45 +0100 |
commit | b1cdc4d04875c3a93161266fc4b9737c157d152a (patch) | |
tree | cf3f5b215ff6c90971b08cb8c6a41eb8b29af585 | |
parent | 9e185aac3540fb6b311cdc89c150f7d657abf113 (diff) | |
download | appstream-glib-b1cdc4d04875c3a93161266fc4b9737c157d152a.tar.gz |
trivial: Fix font generation regression in appstream-builder
Two problems here:
* Don't force an unknown icon to CACHED when reading from a desktop file
* Don't try to convert an icon to a CACHED icon when it's already CACHED.
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-desktop.c | 9 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-icon.c | 4 | ||||
-rw-r--r-- | libappstream-glib/as-app.c | 4 |
3 files changed, 4 insertions, 13 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c index 02f5909..a6943c8 100644 --- a/libappstream-builder/plugins/asb-plugin-desktop.c +++ b/libappstream-builder/plugins/asb-plugin-desktop.c @@ -52,7 +52,6 @@ asb_plugin_desktop_refine (AsbPlugin *plugin, { AsAppParseFlags parse_flags = AS_APP_PARSE_FLAG_USE_HEURISTICS | AS_APP_PARSE_FLAG_ALLOW_VETO; - GPtrArray *icons; g_autoptr(AsApp) desktop_app = NULL; g_autoptr(GdkPixbuf) pixbuf = NULL; @@ -65,14 +64,6 @@ asb_plugin_desktop_refine (AsbPlugin *plugin, if (!as_app_parse_file (desktop_app, filename, parse_flags, error)) return FALSE; - /* convert any UNKNOWN icons to CACHED */ - icons = as_app_get_icons (AS_APP (desktop_app)); - for (guint i = 0; i < icons->len; i++) { - AsIcon *icon = g_ptr_array_index (icons, i); - if (as_icon_get_kind (icon) == AS_ICON_KIND_UNKNOWN) - as_icon_set_kind (icon, AS_ICON_KIND_CACHED); - } - /* copy all metadata */ as_app_subsume_full (AS_APP (app), desktop_app, AS_APP_SUBSUME_FLAG_NO_OVERWRITE | diff --git a/libappstream-builder/plugins/asb-plugin-icon.c b/libappstream-builder/plugins/asb-plugin-icon.c index 1cf9ad3..4abee9a 100644 --- a/libappstream-builder/plugins/asb-plugin-icon.c +++ b/libappstream-builder/plugins/asb-plugin-icon.c @@ -188,6 +188,10 @@ asb_plugin_process_app (AsbPlugin *plugin, return TRUE; } + /* already a cached icon, e.g. a font */ + if (as_icon_get_kind (icon) == AS_ICON_KIND_CACHED) + return TRUE; + /* convert to cached */ switch (as_icon_get_kind (icon)) { case AS_ICON_KIND_LOCAL: diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index d142845..4b21c24 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -3991,10 +3991,6 @@ as_app_subsume_icon (AsApp *app, AsIcon *icon) AsIcon *ic_tmp; guint i; - /* don't add a rubbish icon */ - if (as_icon_get_kind (icon) == AS_ICON_KIND_UNKNOWN) - return; - /* does application already have this icon in this size */ for (i = 0; i < priv->icons->len; i++) { ic_tmp = AS_ICON (g_ptr_array_index (priv->icons, i)); |