summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-06-17 15:08:26 +0100
committerRichard Hughes <richard@hughsie.com>2015-06-17 15:08:26 +0100
commit05356f358d0b1361d6e8939c988bb9864fea6860 (patch)
tree236238d3dcce8695e9fefc7e97aff492fd9744d5
parentfbf4f60e8b925d2bba3a9c34fa9a7c13f93513b8 (diff)
downloadappstream-glib-05356f358d0b1361d6e8939c988bb9864fea6860.tar.gz
Remove the AppData veto when incorporating metadata
-rw-r--r--client/as-util.c6
-rw-r--r--libappstream-glib/as-app.c25
-rw-r--r--libappstream-glib/as-app.h2
3 files changed, 33 insertions, 0 deletions
diff --git a/client/as-util.c b/client/as-util.c
index 68332e8..1f10845 100644
--- a/client/as-util.c
+++ b/client/as-util.c
@@ -3510,6 +3510,9 @@ as_util_incorporate (AsUtilPrivate *priv, gchar **values, GError **error)
as_util_pad_strings (id, "Incorporating...", align);
as_app_subsume_full (app, app_source,
AS_APP_SUBSUME_FLAG_NO_OVERWRITE);
+
+ /* good enough for us now */
+ as_app_remove_veto (app, "Required AppData");
}
/* try to incorporate apps using the package name */
@@ -3533,6 +3536,9 @@ as_util_incorporate (AsUtilPrivate *priv, gchar **values, GError **error)
as_util_pad_strings (id, "Incorporating...", align);
as_app_subsume_full (app, app_source,
AS_APP_SUBSUME_FLAG_NO_OVERWRITE);
+
+ /* good enough for us now */
+ as_app_remove_veto (app, "Required AppData");
}
/* save new store */
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index 6a3103e..ae9c1f0 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -4740,6 +4740,31 @@ as_app_add_veto (AsApp *app, const gchar *fmt, ...)
}
/**
+ * as_app_remove_veto:
+ * @app: A #AsApp
+ * @description: veto string
+ *
+ * Removes a reason to not include the application in the metadata.
+ *
+ * Since: 0.4.1
+ **/
+void
+as_app_remove_veto (AsApp *app, const gchar *description)
+{
+ AsAppPrivate *priv = GET_PRIVATE (app);
+ const gchar *tmp;
+ guint i;
+
+ for (i = 0; i < priv->vetos->len; i++) {
+ tmp = g_ptr_array_index (priv->vetos, i);
+ if (g_strcmp0 (tmp, description) == 0) {
+ g_ptr_array_remove (priv->vetos, (gpointer) tmp);
+ break;
+ }
+ }
+}
+
+/**
* as_app_new:
*
* Creates a new #AsApp.
diff --git a/libappstream-glib/as-app.h b/libappstream-glib/as-app.h
index 467be27..c641dac 100644
--- a/libappstream-glib/as-app.h
+++ b/libappstream-glib/as-app.h
@@ -404,6 +404,8 @@ void as_app_add_veto (AsApp *app,
const gchar *fmt,
...)
G_GNUC_PRINTF(2,3);
+void as_app_remove_veto (AsApp *app,
+ const gchar *description);
guint as_app_search_matches_all (AsApp *app,
gchar **search);
guint as_app_search_matches (AsApp *app,