summaryrefslogtreecommitdiff
path: root/libappstream-builder
diff options
context:
space:
mode:
authorKalev Lember <klember@redhat.com>2015-09-10 15:12:05 +0200
committerKalev Lember <klember@redhat.com>2015-09-10 15:21:38 +0200
commitb1bc5776bb3bbac508b793d00c80cd78d82cc8b3 (patch)
tree3347a2d9d87dd70d4903a1ff62d49e370305cfc1 /libappstream-builder
parent752e45e990a00331290067bdcb07a2f4ab2001ad (diff)
downloadappstream-glib-b1bc5776bb3bbac508b793d00c80cd78d82cc8b3.tar.gz
Use glib's cleanup functions for GString
... and bump glib dep to 2.45.8 for g_autoptr(GString) support.
Diffstat (limited to 'libappstream-builder')
-rw-r--r--libappstream-builder/asb-context.c3
-rw-r--r--libappstream-builder/asb-plugin.h2
-rw-r--r--libappstream-builder/asb-self-test.c10
-rw-r--r--libappstream-builder/plugins/asb-plugin-font.c2
-rw-r--r--libappstream-builder/plugins/asb-plugin-gstreamer.c2
5 files changed, 8 insertions, 11 deletions
diff --git a/libappstream-builder/asb-context.c b/libappstream-builder/asb-context.c
index 57972a6..bb04224 100644
--- a/libappstream-builder/asb-context.c
+++ b/libappstream-builder/asb-context.c
@@ -33,7 +33,6 @@
#include <stdlib.h>
#include <appstream-glib.h>
-#include "as-cleanup.h"
#include "asb-context.h"
#include "asb-context-private.h"
#include "asb-plugin.h"
@@ -920,7 +919,7 @@ asb_context_write_app_xml (AsbContext *ctx)
/* log the XML in the log file */
for (l = priv->apps; l != NULL; l = l->next) {
- _cleanup_string_free_ GString *xml = NULL;
+ g_autoptr(GString) xml = NULL;
g_autoptr(AsStore) store = NULL;
/* we have an open log file? */
diff --git a/libappstream-builder/asb-plugin.h b/libappstream-builder/asb-plugin.h
index c647fb1..20e655a 100644
--- a/libappstream-builder/asb-plugin.h
+++ b/libappstream-builder/asb-plugin.h
@@ -27,8 +27,6 @@
#include <gio/gio.h>
#include <appstream-glib.h>
-#include "as-cleanup.h"
-
#include "asb-app.h"
#include "asb-context.h"
#include "asb-package.h"
diff --git a/libappstream-builder/asb-self-test.c b/libappstream-builder/asb-self-test.c
index 262395f..048d524 100644
--- a/libappstream-builder/asb-self-test.c
+++ b/libappstream-builder/asb-self-test.c
@@ -238,7 +238,7 @@ static void
asb_test_utils_replace_func (void)
{
guint n;
- _cleanup_string_free_ GString *str = NULL;
+ g_autoptr(GString) str = NULL;
str = g_string_new ("I want to have searched for search");
n = asb_string_replace (str, "search", "replace");
@@ -312,9 +312,9 @@ asb_test_context_test_func (AsbTestContextMode mode)
g_autoptr(GFile) file_failed = NULL;
g_autoptr(GFile) file_ignore = NULL;
g_autoptr(GFile) file = NULL;
- _cleanup_string_free_ GString *xml = NULL;
- _cleanup_string_free_ GString *xml_failed = NULL;
- _cleanup_string_free_ GString *xml_ignore = NULL;
+ g_autoptr(GString) xml = NULL;
+ g_autoptr(GString) xml_failed = NULL;
+ g_autoptr(GString) xml_ignore = NULL;
const gchar *filenames[] = {
"test-0.1-1.fc21.noarch.rpm", /* a console app */
"app-1-1.fc21.x86_64.rpm", /* a GUI app */
@@ -861,7 +861,7 @@ asb_test_firmware_func (void)
g_autoptr(AsbContext) ctx = NULL;
g_autoptr(AsStore) store = NULL;
g_autoptr(GFile) file = NULL;
- _cleanup_string_free_ GString *xml = NULL;
+ g_autoptr(GString) xml = NULL;
const gchar *filenames[] = {
"colorhug-als-2.0.1.cab",
"colorhug-als-2.0.0.cab",
diff --git a/libappstream-builder/plugins/asb-plugin-font.c b/libappstream-builder/plugins/asb-plugin-font.c
index b79669c..2a7cc6c 100644
--- a/libappstream-builder/plugins/asb-plugin-font.c
+++ b/libappstream-builder/plugins/asb-plugin-font.c
@@ -83,7 +83,7 @@ asb_font_fix_metadata (AsbApp *app)
gint percentage;
guint j;
g_autoptr(GList) langs = NULL;
- _cleanup_string_free_ GString *str = NULL;
+ g_autoptr(GString) str = NULL;
struct {
const gchar *lang;
const gchar *value;
diff --git a/libappstream-builder/plugins/asb-plugin-gstreamer.c b/libappstream-builder/plugins/asb-plugin-gstreamer.c
index e44aac8..9f0c710 100644
--- a/libappstream-builder/plugins/asb-plugin-gstreamer.c
+++ b/libappstream-builder/plugins/asb-plugin-gstreamer.c
@@ -143,7 +143,7 @@ asb_plugin_process (AsbPlugin *plugin,
g_autofree gchar *app_id = NULL;
g_autoptr(AsbApp) app = NULL;
g_autoptr(AsIcon) icon = NULL;
- _cleanup_string_free_ GString *str = NULL;
+ g_autoptr(GString) str = NULL;
/* use the pkgname suffix as the app-id */
tmp = asb_package_get_name (pkg);