[at-spi] Don't launch at-spi-registryd if /desktop/gnome/interface/accessibility is false



commit fcf8c18ac7d1bcdca625c3a820d44ef2d7ed5d91
Author: Li Yuan <li yuan sun com>
Date:   Thu Jan 7 13:56:08 2010 +0800

    Don't launch at-spi-registryd if /desktop/gnome/interface/accessibility is false
    
    Bug #606254. launch at-spi-registryd if /desktop/gnome/interface/accessibility
    is set and quit it if /desktop/gnome/interface/at-spi-corba is not set.

 configure.in                                |    2 ++
 registryd/at-spi-registryd.desktop.in.in.in |    2 +-
 registryd/registry-main.c                   |   14 ++++++++++++++
 3 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/configure.in b/configure.in
index c557465..8b6a93b 100644
--- a/configure.in
+++ b/configure.in
@@ -29,6 +29,7 @@ dnl required versions of other tools.
 m4_define([req_ver_atk],	[1.29.2])
 m4_define([req_ver_gtk],	[2.10.0])
 m4_define([req_ver_dbus],	[0.76])
+m4_define([req_ver_gconf],	[2.0.0])
 m4_define([req_ver_gail],	[1.9.0])
 m4_define([req_ver_libbonobo],	[1.107.0])
 
@@ -102,6 +103,7 @@ PKG_CHECK_MODULES(REGISTRYD, [
 	atk		>= req_ver_atk
 	gtk+-2.0	>= req_ver_gtk
 	dbus-glib-1     >= req_ver_dbus
+	gconf-2.0	>= req_ver_gconf
 ])
 AC_SUBST(REGISTRYD_LIBS)
 AC_SUBST(REGISTRYD_CFLAGS)
diff --git a/registryd/at-spi-registryd.desktop.in.in.in b/registryd/at-spi-registryd.desktop.in.in.in
index 5b6a460..bbbf738 100644
--- a/registryd/at-spi-registryd.desktop.in.in.in
+++ b/registryd/at-spi-registryd.desktop.in.in.in
@@ -4,7 +4,7 @@ _Name=AT SPI Registry
 Exec= registryddir@/at-spi-registryd
 OnlyShowIn=GNOME;
 NoDisplay=true
-AutostartCondition=GNOME /desktop/gnome/interface/@gconfkey@
+AutostartCondition=GNOME /desktop/gnome/interface/accessibility
 X-GNOME-AutoRestart=true
 X-GNOME-Autostart-Phase=Initialization
 X-GNOME-Bugzilla-Bugzilla=GNOME
diff --git a/registryd/registry-main.c b/registryd/registry-main.c
index 09cf05e..c20de26 100644
--- a/registryd/registry-main.c
+++ b/registryd/registry-main.c
@@ -32,6 +32,8 @@
 #include <glib.h>
 #include "registry.h"
 #include <dbus/dbus-glib.h>
+#include <gconf/gconf-client.h>
+
 
 #define spi_get_display() GDK_DISPLAY()
 
@@ -41,6 +43,8 @@ static void set_gtk_path (DBusGProxy *gsm);
 #endif
 static void set_gtk_modules (DBusGProxy *gsm);
 
+#define CORBA_GCONF_KEY  "/desktop/gnome/interface/at-spi-corba"
+
 #define SM_DBUS_NAME      "org.gnome.SessionManager"
 #define SM_DBUS_PATH      "/org/gnome/SessionManager"
 #define SM_DBUS_INTERFACE "org.gnome.SessionManager"
@@ -177,6 +181,16 @@ main (int argc, char **argv)
   DBusGProxy      *gsm;
   GError          *error;
 
+  GConfClient *gconf_client;
+  gboolean corba_set;
+
+  gconf_client = gconf_client_get_default ();
+  corba_set = gconf_client_get_bool (gconf_client, CORBA_GCONF_KEY, NULL);
+  g_object_unref (gconf_client);
+
+  if (!corba_set)
+    return 0;
+
   if (!bonobo_init (&argc, argv))
     {
       g_error ("Could not initialize oaf / Bonobo");



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