summaryrefslogtreecommitdiff
path: root/libappstream-glib
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-06-06 17:06:09 +0100
committerRichard Hughes <richard@hughsie.com>2014-06-06 17:11:15 +0100
commit81b5337cd933f92bfc10af3510cb8bdd13ad397f (patch)
tree5d000af5205b58946fd010d6413cf3d02c6bd810 /libappstream-glib
parent4f6e1230f7f3d7df873d85d5be5c1a404c3787e5 (diff)
downloadappstream-glib-81b5337cd933f92bfc10af3510cb8bdd13ad397f.tar.gz
Support the non-standard X-Ubuntu-Software-Center-Name
This allows us to use the non-generic form in the metadata.
Diffstat (limited to 'libappstream-glib')
-rw-r--r--libappstream-glib/as-app.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index 96929cd..d1c77d9 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -2553,7 +2553,26 @@ as_app_parse_file_key (AsApp *app,
NULL);
if (tmp != NULL && tmp[0] != '\0')
as_app_set_comment (app, locale, tmp, -1);
+
+ /* non-standard */
+ } else if (g_strcmp0 (key, "X-Ubuntu-Software-Center-Name") == 0) {
+ tmp = g_key_file_get_string (kf,
+ G_KEY_FILE_DESKTOP_GROUP,
+ key,
+ NULL);
+ if (tmp != NULL && tmp[0] != '\0')
+ as_app_set_name (app, "C", tmp, -1);
+ } else if (g_str_has_prefix (key, "X-Ubuntu-Software-Center-Name")) {
+ locale = as_app_desktop_key_get_locale (key);
+ tmp = g_key_file_get_locale_string (kf,
+ G_KEY_FILE_DESKTOP_GROUP,
+ "X-Ubuntu-Software-Center-Name",
+ locale,
+ NULL);
+ if (tmp != NULL && tmp[0] != '\0')
+ as_app_set_name (app, locale, tmp, -1);
}
+
return TRUE;
}