[gnome-software] trivial: Support 'source' appstream entry types
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Support 'source' appstream entry types
- Date: Fri, 7 Feb 2014 21:32:52 +0000 (UTC)
commit 14ef165e772f9a7979cdcbf29274fbf697b412af
Author: Richard Hughes <richard hughsie com>
Date: Fri Feb 7 21:17:21 2014 +0100
trivial: Support 'source' appstream entry types
This is used for improving the description of external repos.
src/plugins/appstream-app.h | 1 +
src/plugins/appstream-cache.c | 2 ++
src/plugins/gs-plugin-appstream.c | 6 ++++--
3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/appstream-app.h b/src/plugins/appstream-app.h
index e9da6c3..eb1b2c6 100644
--- a/src/plugins/appstream-app.h
+++ b/src/plugins/appstream-app.h
@@ -43,6 +43,7 @@ typedef enum {
APPSTREAM_APP_ID_KIND_FONT,
APPSTREAM_APP_ID_KIND_CODEC,
APPSTREAM_APP_ID_KIND_WEBAPP,
+ APPSTREAM_APP_ID_KIND_SOURCE,
APPSTREAM_APP_ID_KIND_LAST
} AppstreamAppIdKind;
diff --git a/src/plugins/appstream-cache.c b/src/plugins/appstream-cache.c
index 8b08b27..4238137 100644
--- a/src/plugins/appstream-cache.c
+++ b/src/plugins/appstream-cache.c
@@ -141,6 +141,8 @@ appstream_cache_app_id_kind_from_string (const gchar *id_kind)
return APPSTREAM_APP_ID_KIND_CODEC;
if (g_strcmp0 (id_kind, "webapp") == 0)
return APPSTREAM_APP_ID_KIND_WEBAPP;
+ if (g_strcmp0 (id_kind, "source") == 0)
+ return APPSTREAM_APP_ID_KIND_SOURCE;
return APPSTREAM_APP_ID_KIND_UNKNOWN;
}
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 550baae..659bebc 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -523,8 +523,10 @@ gs_plugin_refine_item (GsPlugin *plugin,
/* is an app */
if (gs_app_get_kind (app) == GS_APP_KIND_UNKNOWN ||
- gs_app_get_kind (app) == GS_APP_KIND_PACKAGE)
- gs_app_set_kind (app, GS_APP_KIND_NORMAL);
+ gs_app_get_kind (app) == GS_APP_KIND_PACKAGE) {
+ if (gs_app_get_state (app) != GS_APP_STATE_LOCAL)
+ gs_app_set_kind (app, GS_APP_KIND_NORMAL);
+ }
/* set id */
if (appstream_app_get_id (item) != NULL && gs_app_get_id (app) == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]