summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libappstream-builder/asb-self-test.c4
-rw-r--r--libappstream-builder/asb-utils.c2
-rw-r--r--libappstream-builder/plugins/asb-plugin-hardcoded.c10
-rw-r--r--libappstream-glib/as-enums.c4
-rw-r--r--libappstream-glib/as-enums.h2
5 files changed, 19 insertions, 3 deletions
diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c
index 5a308f5..1e2e6aa 100644
--- a/libappstream-builder/asb-self-test.c
+++ b/libappstream-builder/asb-self-test.c
@@ -333,7 +333,7 @@ asb_test_context_test_func (AsbTestContextMode mode)
/* check it matches what we expect */
xml = as_store_to_xml (store, AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE);
expected_xml =
- "<components version=\"0.8\" builder_id=\"appstream-glib:3\" origin=\"asb-self-test\">\n"
+ "<components version=\"0.8\" builder_id=\"appstream-glib:4\" origin=\"asb-self-test\">\n"
"<component type=\"addon\">\n"
"<id>app-extra</id>\n"
"<pkgname>app-extra</pkgname>\n"
@@ -412,7 +412,7 @@ asb_test_context_test_func (AsbTestContextMode mode)
/* check output */
xml_failed = as_store_to_xml (store_failed, AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE);
expected_xml =
- "<components version=\"0.8\" builder_id=\"appstream-glib:3\" origin=\"asb-self-test-failed\">\n"
+ "<components version=\"0.8\" builder_id=\"appstream-glib:4\" origin=\"asb-self-test-failed\">\n"
"<component type=\"desktop\">\n"
"<id>console1.desktop</id>\n"
"<pkgname>app-console</pkgname>\n"
diff --git a/libappstream-builder/asb-utils.c b/libappstream-builder/asb-utils.c
index ae220f8..e5ff1b4 100644
--- a/libappstream-builder/asb-utils.c
+++ b/libappstream-builder/asb-utils.c
@@ -37,7 +37,7 @@
#include "asb-utils.h"
#include "asb-plugin.h"
-#define ASB_METADATA_CACHE_VERSION 3
+#define ASB_METADATA_CACHE_VERSION 4
/**
* asb_utils_get_builder_id:
diff --git a/libappstream-builder/plugins/asb-plugin-hardcoded.c b/libappstream-builder/plugins/asb-plugin-hardcoded.c
index c86dff7..df2834e 100644
--- a/libappstream-builder/plugins/asb-plugin-hardcoded.c
+++ b/libappstream-builder/plugins/asb-plugin-hardcoded.c
@@ -217,6 +217,16 @@ asb_plugin_process_app (AsbPlugin *plugin,
}
}
+ /* look for a high contrast icon */
+ for (i = 0; filelist[i] != NULL; i++) {
+ if (g_str_has_prefix (filelist[i],
+ "/usr/share/icons/HighContrast/")) {
+ as_app_add_kudo_kind (AS_APP (app),
+ AS_KUDO_KIND_HIGH_CONTRAST);
+ break;
+ }
+ }
+
/* look for a modern toolkit */
deps = asb_package_get_deps (pkg);
for (i = 0; deps != NULL && deps[i] != NULL; i++) {
diff --git a/libappstream-glib/as-enums.c b/libappstream-glib/as-enums.c
index 70a24ac..0b5d1dc 100644
--- a/libappstream-glib/as-enums.c
+++ b/libappstream-glib/as-enums.c
@@ -211,6 +211,8 @@ as_kudo_kind_to_string (AsKudoKind kudo_kind)
return "ModernToolkit";
if (kudo_kind == AS_KUDO_KIND_NOTIFICATIONS)
return "Notifications";
+ if (kudo_kind == AS_KUDO_KIND_HIGH_CONTRAST)
+ return "HighContrast";
return NULL;
}
@@ -237,5 +239,7 @@ as_kudo_kind_from_string (const gchar *kudo_kind)
return AS_KUDO_KIND_MODERN_TOOLKIT;
if (g_strcmp0 (kudo_kind, "Notifications") == 0)
return AS_KUDO_KIND_NOTIFICATIONS;
+ if (g_strcmp0 (kudo_kind, "HighContrast") == 0)
+ return AS_KUDO_KIND_HIGH_CONTRAST;
return AS_KUDO_KIND_UNKNOWN;
}
diff --git a/libappstream-glib/as-enums.h b/libappstream-glib/as-enums.h
index 6624f45..4a37d7f 100644
--- a/libappstream-glib/as-enums.h
+++ b/libappstream-glib/as-enums.h
@@ -106,6 +106,7 @@ typedef enum {
* @AS_KUDO_KIND_APP_MENU: Uses the GNOME application menu
* @AS_KUDO_KIND_MODERN_TOOLKIT: Uses a modern toolkit like GTK3 or QT5
* @AS_KUDO_KIND_NOTIFICATIONS: Registers notifications with KDE or GNOME
+ * @AS_KUDO_KIND_HIGH_CONTRAST: Installs a high contrast icon
*
* The kudo type.
**/
@@ -116,6 +117,7 @@ typedef enum {
AS_KUDO_KIND_APP_MENU, /* Since: 0.2.2 */
AS_KUDO_KIND_MODERN_TOOLKIT, /* Since: 0.2.2 */
AS_KUDO_KIND_NOTIFICATIONS, /* Since: 0.2.2 */
+ AS_KUDO_KIND_HIGH_CONTRAST, /* Since: 0.3.0 */
/*< private >*/
AS_KUDO_KIND_LAST
} AsKudoKind;