diff options
author | Richard Hughes <richard@hughsie.com> | 2014-04-21 12:49:15 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-04-21 12:49:15 +0100 |
commit | bfa3199084c97ef15e49b618d9a40be0cb1d4c0f (patch) | |
tree | d5d977dc1da01fb629b544cafc764a89fa8b5469 | |
parent | b418383e5e87b2523737569e71818b8d95b25187 (diff) | |
download | appstream-glib-bfa3199084c97ef15e49b618d9a40be0cb1d4c0f.tar.gz |
Collect certain errors when parsing file-backed AsApp's
-rw-r--r-- | libappstream-glib/as-app-private.h | 10 | ||||
-rw-r--r-- | libappstream-glib/as-app.c | 18 |
2 files changed, 28 insertions, 0 deletions
diff --git a/libappstream-glib/as-app-private.h b/libappstream-glib/as-app-private.h index 6cdbe88..4e54efb 100644 --- a/libappstream-glib/as-app-private.h +++ b/libappstream-glib/as-app-private.h @@ -32,6 +32,16 @@ G_BEGIN_DECLS +typedef enum { + AS_APP_PROBLEM_NONE = 0, + AS_APP_PROBLEM_NO_XML_HEADER = 1 << 0, + AS_APP_PROBLEM_NO_COPYRIGHT_INFO = 1 << 1, + AS_APP_PROBLEM_DEPRECATED_LICENCE = 1 << 2, + AS_APP_PROBLEM_MULTIPLE_ENTRIES = 1 << 3, + AS_APP_PROBLEM_LAST +} AsAppProblems; + +AsAppProblems as_app_get_problems (AsApp *app); void as_app_set_source_kind (AsApp *app, AsAppSourceKind source_kind); guint as_app_get_name_size (AsApp *app); diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index b2e812c..c0bf047 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -47,6 +47,7 @@ typedef struct _AsAppPrivate AsAppPrivate; struct _AsAppPrivate { + AsAppProblems problems; AsIconKind icon_kind; AsIdKind id_kind; GHashTable *comments; /* of locale:string */ @@ -444,6 +445,23 @@ as_app_get_source_kind (AsApp *app) } /** + * as_app_get_problems: (skip) + * @app: a #AsApp instance. + * + * Gets the bitfield of problems. + * + * Returns: problems encountered during parsing the application + * + * Since: 0.1.4 + **/ +AsAppProblems +as_app_get_problems (AsApp *app) +{ + AsAppPrivate *priv = GET_PRIVATE (app); + return priv->problems; +} + +/** * as_app_get_icon_kind: * @app: a #AsApp instance. * |