[dconf/wip/peruserprofile: 3/5] engine: if a dconf.profile file or link is placed in XDG_RUNTIME_DIR that takes precedence over othe
- From: Alberto Ruiz <aruiz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf/wip/peruserprofile: 3/5] engine: if a dconf.profile file or link is placed in XDG_RUNTIME_DIR that takes precedence over othe
- Date: Wed, 14 Oct 2015 17:07:53 +0000 (UTC)
commit 7d6a894e4912460019763b0e5cb7304ead30f4cb
Author: Alberto Ruiz <aruiz redhat com>
Date: Tue Jul 14 21:32:52 2015 +0100
engine: if a dconf.profile file or link is placed in XDG_RUNTIME_DIR that takes precedence over other
profile files
engine/dconf-engine-profile.c | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/engine/dconf-engine-profile.c b/engine/dconf-engine-profile.c
index d3163b5..932479a 100644
--- a/engine/dconf-engine-profile.c
+++ b/engine/dconf-engine-profile.c
@@ -224,6 +224,21 @@ dconf_engine_open_profile_file (const gchar *profile)
return fp;
}
+static FILE *
+dconf_engine_get_runtime_profile (void) {
+ gchar *filename;
+ FILE *fp;
+
+ filename = g_build_filename (g_get_user_runtime_dir (), "dconf.profile", NULL);
+ fp = fopen (filename, "r");
+
+ if (fp == NULL)
+ g_debug ("Unable to open %s: %s", filename, g_strerror (errno));
+
+ g_free (filename);
+ return fp;
+}
+
DConfEngineSource **
dconf_engine_profile_open (const gchar *profile,
gint *n_sources)
@@ -236,7 +251,10 @@ dconf_engine_profile_open (const gchar *profile,
if (profile == NULL)
{
- file = dconf_engine_open_profile_file ("user");
+ file = dconf_engine_get_runtime_profile ();
+
+ if (file == NULL)
+ file = dconf_engine_open_profile_file ("user");
/* Only in the case that no profile was specified do we use this
* fallback.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]