~canonical-dx-team/unity/unity.fix-ql-losing-focus

« back to all changes in this revision

Viewing changes to services/panel-a11y.c

Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Authored by: Rodrigo Moya <rodrigo.moya@canonical.com>
17
17
 */
18
18
 
 
19
#include <gconf/gconf-client.h>
19
20
#include <gio/gio.h>
 
21
 
20
22
#include "panel-a11y.h"
21
23
#include "panel-util-accessible.h"
22
24
 
23
25
static gboolean a11y_initialized = FALSE;
24
26
 
25
27
#define INIT_METHOD "gnome_accessibility_module_init"
26
 
#define DESKTOP_SCHEMA "org.gnome.desktop.interface"
27
 
#define ACCESSIBILITY_ENABLED_KEY "accessibility"
 
28
#define A11Y_GCONF_KEY "/desktop/gnome/interface/accessibility"
28
29
#define AT_SPI_SCHEMA "org.a11y.atspi"
29
30
#define ATK_BRIDGE_LOCATION_KEY "atk-bridge-location"
30
31
 
53
54
static gboolean
54
55
should_enable_a11y (void)
55
56
{
56
 
  GSettings *desktop_settings = NULL;
 
57
  GConfClient *client = NULL;
57
58
  gboolean value = FALSE;
58
 
 
59
 
  if (!has_gsettings_schema (DESKTOP_SCHEMA))
60
 
    return FALSE;
61
 
 
62
 
  desktop_settings = g_settings_new (DESKTOP_SCHEMA);
63
 
  value = g_settings_get_boolean (desktop_settings, ACCESSIBILITY_ENABLED_KEY);
64
 
 
65
 
  g_object_unref (desktop_settings);
 
59
  GError *error = NULL;
 
60
 
 
61
  client = gconf_client_get_default ();
 
62
  value = gconf_client_get_bool (client, A11Y_GCONF_KEY, &error);
 
63
  if (error != NULL)
 
64
    {
 
65
      g_warning ("Error getting gconf variable %s, a11y disabled by default",
 
66
                 A11Y_GCONF_KEY);
 
67
      g_error_free (error);
 
68
    }
 
69
  g_object_unref (client);
66
70
 
67
71
  return value;
68
72
}