[gnome-software] Support the new HighContrast kudo
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Support the new HighContrast kudo
- Date: Thu, 28 Aug 2014 09:59:07 +0000 (UTC)
commit d375a1121340145aca0f7d97fe24becec4815a9b
Author: Richard Hughes <richard hughsie com>
Date: Thu Aug 28 10:57:30 2014 +0100
Support the new HighContrast kudo
src/gs-app.c | 4 ++++
src/gs-app.h | 1 +
src/plugins/gs-plugin-appstream.c | 5 +++++
3 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 0569a64..ba7d183 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -207,6 +207,8 @@ gs_app_to_string (GsApp *app)
g_string_append (str, "\tkudo:\tibus-has-symbol\n");
if ((priv->kudos & GS_APP_KUDO_PERFECT_SCREENSHOTS) > 0)
g_string_append (str, "\tkudo:\tperfect-screenshots\n");
+ if ((priv->kudos & GS_APP_KUDO_HIGH_CONTRAST) > 0)
+ g_string_append (str, "\tkudo:\thigh-contrast\n");
g_string_append_printf (str, "\tkudo-percentage:\t%i\n",
gs_app_get_kudos_percentage (app));
if (priv->name != NULL)
@@ -1685,6 +1687,8 @@ gs_app_get_kudos_percentage (GsApp *app)
percentage += 20;
if ((app->priv->kudos & GS_APP_KUDO_PERFECT_SCREENSHOTS) > 0)
percentage += 20;
+ if ((app->priv->kudos & GS_APP_KUDO_HIGH_CONTRAST) > 0)
+ percentage += 20;
/* popular apps should be at *least* 50% */
if ((app->priv->kudos & GS_APP_KUDO_POPULAR) > 0)
diff --git a/src/gs-app.h b/src/gs-app.h
index 59575b8..9fbe3ec 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -88,6 +88,7 @@ typedef enum {
GS_APP_KUDO_POPULAR = 1 << 10,
GS_APP_KUDO_IBUS_HAS_SYMBOL = 1 << 11,
GS_APP_KUDO_PERFECT_SCREENSHOTS = 1 << 12,
+ GS_APP_KUDO_HIGH_CONTRAST = 1 << 13,
GS_APP_KUDO_LAST
} GsAppKudo;
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index f2a1fb4..e950db7 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -613,6 +613,11 @@ gs_plugin_refine_item (GsPlugin *plugin,
case AS_KUDO_KIND_NOTIFICATIONS:
gs_app_add_kudo (app, GS_APP_KUDO_USES_NOTIFICATIONS);
break;
+#if AS_CHECK_VERSION(0,3,0)
+ case AS_KUDO_KIND_HIGH_CONTRAST:
+ gs_app_add_kudo (app, GS_APP_KUDO_HIGH_CONTRAST);
+ break;
+#endif
default:
g_debug ("no idea how to handle kudo '%s'", tmp);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]