gconf r2601 - in trunk: . gconf



Author: halfline
Date: Wed May 21 18:56:22 2008
New Revision: 2601
URL: http://svn.gnome.org/viewvc/gconf?rev=2601&view=rev

Log:
2008-05-21  Ray Strode  <rstrode redhat com>

	* gconf/gconftool.c (main): Fall back to local
	database access if not in active session. (bug 533494)

	* gconf/gconf-internals.c (get_ior):
	Don't bother trying to autolaunch bus if DISPLAY isn't
	set.



Modified:
   trunk/ChangeLog
   trunk/gconf/gconf-internals.c
   trunk/gconf/gconftool.c

Modified: trunk/gconf/gconf-internals.c
==============================================================================
--- trunk/gconf/gconf-internals.c	(original)
+++ trunk/gconf/gconf-internals.c	Wed May 21 18:56:22 2008
@@ -2432,7 +2432,8 @@
         /* if the bus isn't running and we don't want to start gconfd then
          * we don't want to autolaunch the bus either, so bail early.
          */
-        if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL && !start_if_not_found) {
+        if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL &&
+           (!start_if_not_found || g_getenv ("DISPLAY") == NULL)) {
                 if (failure_log)
                     g_string_append_printf (failure_log,
                                             _("Not running within active session"));

Modified: trunk/gconf/gconftool.c
==============================================================================
--- trunk/gconf/gconftool.c	(original)
+++ trunk/gconf/gconftool.c	Wed May 21 18:56:22 2008
@@ -890,7 +890,27 @@
     }
 
   if (config_source == NULL)
-    conf = gconf_engine_get_default();
+    {
+        /* If we aren't running from within a session,
+         * assume we'll be touching the database locally
+         */
+      conf = NULL;
+      if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL)
+        {
+          char *conffile;
+          GSList *addresses;
+
+          conffile = g_strconcat (GCONF_CONFDIR, "/path", NULL);
+          addresses = gconf_load_source_path (conffile, NULL);
+          g_free(conffile);
+
+          conf = gconf_engine_get_local_for_addresses (addresses, &err);
+          gconf_address_list_free (addresses);
+        }
+
+      if (conf == NULL)
+        conf = gconf_engine_get_default();
+    }
   else
     {
       GSList *addresses;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]