diff options
author | Matthias Klumpp <matthias@tenstral.net> | 2016-08-11 17:50:48 +0200 |
---|---|---|
committer | Matthias Klumpp <matthias@tenstral.net> | 2016-08-11 17:50:48 +0200 |
commit | ea8b160c8f05ae018dcf54181204cc5740c2aa1c (patch) | |
tree | c3e05a004c6ed93a2db5f76f50343c9bbbfef3db | |
parent | 435ad105aa8c8b73f8d981aae6a25a89db423796 (diff) | |
download | appstream-glib-ea8b160c8f05ae018dcf54181204cc5740c2aa1c.tar.gz |
Make asglib read current component-type names
-rw-r--r-- | libappstream-glib/as-app.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index 177a66a..800decf 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -193,7 +193,7 @@ as_app_kind_to_string (AsAppKind kind) AsAppKind as_app_kind_from_string (const gchar *kind) { - if (g_strcmp0 (kind, "desktop") == 0) + if (g_strcmp0 (kind, "desktop-application") == 0) return AS_APP_KIND_DESKTOP; if (g_strcmp0 (kind, "codec") == 0) return AS_APP_KIND_CODEC; @@ -201,7 +201,7 @@ as_app_kind_from_string (const gchar *kind) return AS_APP_KIND_FONT; if (g_strcmp0 (kind, "inputmethod") == 0) return AS_APP_KIND_INPUT_METHOD; - if (g_strcmp0 (kind, "webapp") == 0) + if (g_strcmp0 (kind, "web-application") == 0) return AS_APP_KIND_WEB_APP; if (g_strcmp0 (kind, "source") == 0) return AS_APP_KIND_SOURCE; @@ -221,6 +221,15 @@ as_app_kind_from_string (const gchar *kind) return AS_APP_KIND_SHELL_EXTENSION; if (g_strcmp0 (kind, "localization") == 0) return AS_APP_KIND_LOCALIZATION; + + /* legacy */ + if (g_strcmp0 (kind, "desktop") == 0) + return AS_APP_KIND_DESKTOP; + if (g_strcmp0 (kind, "desktop-app") == 0) + return AS_APP_KIND_DESKTOP; + if (g_strcmp0 (kind, "webapp") == 0) + return AS_APP_KIND_WEB_APP; + return AS_APP_KIND_UNKNOWN; } |