From dc9bb88f93f35a0057962e65e2cba6a86b454b08 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Sat, 9 Aug 2014 16:17:12 +0200 Subject: Add as_app_add_veto() This is simply moving asb_add_add_veto() into the base-class and in turn makes it stable API. --- libappstream-builder/asb-app.c | 50 +++------------------- libappstream-builder/asb-app.h | 5 --- libappstream-builder/asb-context.c | 8 ++-- libappstream-builder/asb-plugin-loader.c | 2 +- libappstream-builder/asb-task.c | 10 ++--- .../plugins/asb-plugin-blacklist.c | 2 +- libappstream-builder/plugins/asb-plugin-desktop.c | 12 +++--- .../plugins/asb-plugin-hardcoded.c | 10 ++--- libappstream-glib/as-app.c | 42 ++++++++++++++++++ libappstream-glib/as-app.h | 5 +++ 10 files changed, 74 insertions(+), 72 deletions(-) diff --git a/libappstream-builder/asb-app.c b/libappstream-builder/asb-app.c index 78cfd81..374fb89 100644 --- a/libappstream-builder/asb-app.c +++ b/libappstream-builder/asb-app.c @@ -38,7 +38,6 @@ typedef struct _AsbAppPrivate AsbAppPrivate; struct _AsbAppPrivate { - GPtrArray *vetos; GPtrArray *requires_appdata; GdkPixbuf *pixbuf; AsbPackage *pkg; @@ -58,7 +57,6 @@ asb_app_finalize (GObject *object) AsbApp *app = ASB_APP (object); AsbAppPrivate *priv = GET_PRIVATE (app); - g_ptr_array_unref (priv->vetos); g_ptr_array_unref (priv->requires_appdata); if (priv->pixbuf != NULL) g_object_unref (priv->pixbuf); @@ -75,7 +73,6 @@ static void asb_app_init (AsbApp *app) { AsbAppPrivate *priv = GET_PRIVATE (app); - priv->vetos = g_ptr_array_new_with_free_func (g_free); priv->requires_appdata = g_ptr_array_new_with_free_func (g_free); /* all untrusted */ @@ -131,12 +128,14 @@ void asb_app_set_veto_description (AsbApp *app) { AsbAppPrivate *priv = GET_PRIVATE (app); + GPtrArray *vetos; const gchar *tmp; guint i; _cleanup_string_free_ GString *str = NULL; /* application has no vetos */ - if (priv->vetos->len == 0) + vetos = as_app_get_vetos (AS_APP (app)); + if (vetos->len == 0) return; /* log */ @@ -148,9 +147,9 @@ asb_app_set_veto_description (AsbApp *app) /* update description */ str = g_string_new ("

Not included in metadata because:

"); g_string_append (str, "