diff options
author | Richard Hughes <richard@hughsie.com> | 2015-07-23 11:08:12 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-07-23 11:08:14 +0100 |
commit | 9779a36bfbed6921a85a21304f548cff0a229274 (patch) | |
tree | 6a2b5eef535c591bb27dd8a6d684f5eb2610280d | |
parent | 1c2c2d3bda1d898e0ac4a1fad021dc13f14dc02c (diff) | |
download | appstream-glib-9779a36bfbed6921a85a21304f548cff0a229274.tar.gz |
Only add the HiDPI kudo for desktop applications using stock icons
This makes little sense for other component types such as addons or firmware.
-rw-r--r-- | libappstream-builder/asb-self-test.c | 6 | ||||
-rw-r--r-- | libappstream-glib/as-app.c | 13 |
2 files changed, 10 insertions, 9 deletions
diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c index 0311938..d332b3c 100644 --- a/libappstream-builder/asb-self-test.c +++ b/libappstream-builder/asb-self-test.c @@ -420,9 +420,6 @@ asb_test_context_test_func (AsbTestContextMode mode) "<description><p>Updating the firmware on your ColorHug device " "improves performance and adds new features.</p></description>\n" "<icon type=\"stock\">application-x-executable</icon>\n" - "<kudos>\n" - "<kudo>HiDpiIcon</kudo>\n" - "</kudos>\n" "<url type=\"homepage\">http://www.hughski.com/</url>\n" "<releases>\n" "<release version=\"2.0.2\" timestamp=\"1424116753\">\n" @@ -922,9 +919,6 @@ asb_test_firmware_func (void) "<description><p>Updating the firmware on your ColorHug device " "improves performance and adds new features.</p></description>\n" "<icon type=\"stock\">application-x-executable</icon>\n" - "<kudos>\n" - "<kudo>HiDpiIcon</kudo>\n" - "</kudos>\n" "<url type=\"homepage\">http://www.hughski.com/</url>\n" "<releases>\n" "<release version=\"2.0.2\" timestamp=\"1424116753\">\n" diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index 8e8b7a1..50f1631 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -2325,9 +2325,16 @@ as_app_add_icon (AsApp *app, AsIcon *icon) } } - /* assume that stock icons are available in HiDPI sizes */ - if (as_icon_get_kind (icon) == AS_ICON_KIND_STOCK) - as_app_add_kudo_kind (app, AS_KUDO_KIND_HI_DPI_ICON); + /* assume that desktop stock icons are available in HiDPI sizes */ + if (as_icon_get_kind (icon) == AS_ICON_KIND_STOCK) { + switch (priv->id_kind) { + case AS_ID_KIND_DESKTOP: + as_app_add_kudo_kind (app, AS_KUDO_KIND_HI_DPI_ICON); + break; + default: + break; + } + } g_ptr_array_add (priv->icons, g_object_ref (icon)); } |