[dconf/wip/override] engine: allow overriding the config directory used by dconf
- From: Abderrahim Kitouni <akitouni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf/wip/override] engine: allow overriding the config directory used by dconf
- Date: Wed, 3 Oct 2018 13:11:07 +0000 (UTC)
commit e8794ddd6107ce7b2acb2b46796309056611cfdc
Author: Abderrahim Kitouni <akitouni gnome org>
Date: Wed Oct 3 14:05:10 2018 +0100
engine: allow overriding the config directory used by dconf
This is used by flatpak. This patch is present in all flatpak runtimes and
was likely originally written by Alexander Larsson.
engine/dconf-engine-source-user.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/engine/dconf-engine-source-user.c b/engine/dconf-engine-source-user.c
index 1657875..b6b8772 100644
--- a/engine/dconf-engine-source-user.c
+++ b/engine/dconf-engine-source-user.c
@@ -39,11 +39,17 @@ dconf_engine_source_user_open_gvdb (const gchar *name)
{
GvdbTable *table;
gchar *filename;
+ const gchar *override;
+
+ override = g_getenv ("DCONF_USER_CONFIG_DIR");
+ if (override == NULL)
+ filename = g_build_filename (g_get_user_config_dir (), "dconf", name, NULL);
+ else
+ filename = g_build_filename (g_get_home_dir (), override, name, NULL);
/* This can fail in the normal case of the user not having any
* settings. That's OK and it shouldn't be considered as an error.
*/
- filename = g_build_filename (g_get_user_config_dir (), "dconf", name, NULL);
table = gvdb_table_new (filename, FALSE, NULL);
g_free (filename);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]