[gnome-software] Add an extra star if the IBus component defines a symbol
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Add an extra star if the IBus component defines a symbol
- Date: Thu, 17 Apr 2014 15:05:02 +0000 (UTC)
commit 89ad4674e0d4581fced009cff5b41289ab8064ae
Author: Richard Hughes <richard hughsie com>
Date: Thu Apr 17 15:57:19 2014 +0100
Add an extra star if the IBus component defines a symbol
src/gs-app.c | 4 ++++
src/gs-app.h | 1 +
src/plugins/gs-plugin-appstream.c | 2 ++
3 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index f786c0b..465e1c6 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -245,6 +245,8 @@ gs_app_to_string (GsApp *app)
g_string_append (str, "\tkudo:\thas-screenshots\n");
if ((priv->kudos & GS_APP_KUDO_POPULAR) > 0)
g_string_append (str, "\tkudo:\tpopular\n");
+ if ((priv->kudos & GS_APP_KUDO_IBUS_HAS_SYMBOL) > 0)
+ g_string_append (str, "\tkudo:\tibus-has-symbol\n");
g_string_append_printf (str, "\tkudo-percentage:\t%i\n",
gs_app_get_kudos_percentage (app));
if (priv->name != NULL)
@@ -1674,6 +1676,8 @@ gs_app_get_kudos_percentage (GsApp *app)
percentage += 10;
if ((app->priv->kudos & GS_APP_KUDO_HAS_SCREENSHOTS) > 0)
percentage += 20;
+ if ((app->priv->kudos & GS_APP_KUDO_IBUS_HAS_SYMBOL) > 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 577d4d8..43bcba5 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -110,6 +110,7 @@ typedef enum {
GS_APP_KUDO_USES_APP_MENU = 1 << 8,
GS_APP_KUDO_HAS_SCREENSHOTS = 1 << 9,
GS_APP_KUDO_POPULAR = 1 << 10,
+ GS_APP_KUDO_IBUS_HAS_SYMBOL = 1 << 11,
GS_APP_KUDO_LAST
} GsAppKudo;
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 4bcdb6d..d474a45 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -483,6 +483,8 @@ gs_plugin_refine_item (GsPlugin *plugin,
gs_app_add_kudo (app, GS_APP_KUDO_USES_APP_MENU);
if (as_app_get_metadata_item (item, "X-Kudo-Popular") != NULL)
gs_app_add_kudo (app, GS_APP_KUDO_POPULAR);
+ if (as_app_get_metadata_item (item, "X-IBus-Symbol") != NULL)
+ gs_app_add_kudo (app, GS_APP_KUDO_IBUS_HAS_SYMBOL);
out:
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]