summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2011-11-14 16:13:27 +0100
committerRoss Burton <ross@linux.intel.com>2011-11-28 14:31:56 +0000
commitc129898afaa562ffc38f434e5e0c607f525101b8 (patch)
treea474c06e3fc5c72c80369d6d383973936d42d2b5
parente203d15c02b64f0e74498f85b52d9ca876baa996 (diff)
downloadgconf-c129898afaa562ffc38f434e5e0c607f525101b8.tar.gz
D-Bus backend: Add GCONF_DEFAULT_SOURCE_PATH support (#664031)
Forward-port 7baf4c6b33a6dd0697a8bdb81bd86c72d58ebdc6 ("Allow overriding the default config via $GCONF_DEFAULT_SOURCE_PATH") from the ORBit to the D-Bus backend to fix (sugar-)jhbuild breakage when building with --disable-orbit.
-rw-r--r--gconf/gconf-dbus.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/gconf/gconf-dbus.c b/gconf/gconf-dbus.c
index 817a1f99..9f92125d 100644
--- a/gconf/gconf-dbus.c
+++ b/gconf/gconf-dbus.c
@@ -76,8 +76,6 @@ struct _GConfEngine {
gpointer owner;
int owner_use_count;
-
- guint is_default : 1;
/* If TRUE, this is a local engine (and therefore
* has no ctable and no notifications)
@@ -299,7 +297,6 @@ gconf_engine_blank (gboolean remote)
conf->local_sources = NULL;
conf->is_local = FALSE;
- conf->is_default = TRUE;
}
else
{
@@ -308,7 +305,6 @@ gconf_engine_blank (gboolean remote)
conf->notify_dirs = NULL;
conf->local_sources = NULL;
conf->is_local = TRUE;
- conf->is_default = FALSE;
}
return conf;
@@ -512,8 +508,8 @@ ensure_database (GConfEngine *conf,
if (conf->database != NULL)
return TRUE;
-
- if (conf->is_default)
+
+ if (conf->addresses == NULL)
{
message = dbus_message_new_method_call (GCONF_DBUS_SERVICE,
GCONF_DBUS_SERVER_OBJECT,
@@ -811,7 +807,9 @@ GConfEngine*
gconf_engine_get_default (void)
{
GConfEngine* conf = NULL;
-
+ const gchar* source_path;
+ GError* err = NULL;
+
if (default_engine)
conf = default_engine;
@@ -819,9 +817,21 @@ gconf_engine_get_default (void)
{
conf = gconf_engine_blank (TRUE);
- conf->is_default = TRUE;
-
default_engine = conf;
+
+ source_path = g_getenv ("GCONF_DEFAULT_SOURCE_PATH");
+ if (source_path != NULL)
+ {
+ conf->addresses = gconf_load_source_path (source_path, &err);
+ if (err)
+ {
+ g_warning ("Could not parse GCONF_DEFAULT_SOURCE_PATH: %s",
+ err->message);
+ g_error_free (err);
+ }
+ }
+ else
+ conf->addresses = NULL;
}
else
conf->refcount += 1;
@@ -843,7 +853,6 @@ gconf_engine_get_for_address (const gchar* address, GError** err)
{
conf = gconf_engine_blank (TRUE);
- conf->is_default = FALSE;
conf->addresses = addresses;
if (!ensure_database (conf, TRUE, err))
@@ -877,7 +886,6 @@ gconf_engine_get_for_addresses (GSList *addresses, GError** err)
conf = gconf_engine_blank (TRUE);
- conf->is_default = FALSE;
conf->addresses = NULL;
tmp = addresses;