[gnome-software] Allow string replacements when using gs_app_set_metadata()
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Allow string replacements when using gs_app_set_metadata()
- Date: Mon, 28 Mar 2016 14:30:59 +0000 (UTC)
commit 6398095a38e8dc1813bd8a24ddf8aee2faa7a8f4
Author: Richard Hughes <richard hughsie com>
Date: Mon Mar 28 12:23:24 2016 +0100
Allow string replacements when using gs_app_set_metadata()
src/gs-app.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 3eb03f7..071ee4c 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1724,6 +1724,7 @@ void
gs_app_set_metadata (GsApp *app, const gchar *key, const gchar *value)
{
const gchar *found;
+ GString *str;
g_return_if_fail (GS_IS_APP (app));
@@ -1742,9 +1743,11 @@ gs_app_set_metadata (GsApp *app, const gchar *key, const gchar *value)
key, found, value);
return;
}
+ str = g_string_new (value);
+ as_utils_string_replace (str, "@datadir@", DATADIR);
g_hash_table_insert (app->metadata,
g_strdup (key),
- g_strdup (value));
+ g_string_free (str, FALSE));
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]