[gnome-settings-daemon] keyboard: use gsettings, not gconf
- From: Sergey V. Udaltsov <svu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] keyboard: use gsettings, not gconf
- Date: Thu, 14 Oct 2010 23:43:09 +0000 (UTC)
commit 786531ecea46dbbe2fb9bdea25a985db5bf36878
Author: Sergey V. Udaltsov <svu gnome org>
Date: Fri Oct 15 00:41:49 2010 +0100
keyboard: use gsettings, not gconf
Planned API upgrade
configure.ac | 1 +
data/Makefile.am | 1 +
...tings-daemon.plugins.keyboard.gschema.xml.in.in | 14 +++++++++++
plugins/keyboard/gsd-keyboard-xkb.c | 25 ++++++++-----------
plugins/keyboard/gsd-keyboard-xkb.h | 3 --
5 files changed, 27 insertions(+), 17 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c6a551e..a442278 100644
--- a/configure.ac
+++ b/configure.ac
@@ -452,6 +452,7 @@ data/gnome-settings-daemon.pc
data/gnome-settings-daemon-uninstalled.pc
data/org.gnome.settings-daemon.plugins.gschema.xml.in
data/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in
+data/org.gnome.settings-daemon.plugins.keyboard.gschema.xml.in
data/org.gnome.settings-daemon.plugins.media-keys.gschema.xml.in
data/org.gnome.settings-daemon.peripherals.gschema.xml.in
data/org.gnome.settings-daemon.plugins.housekeeping.gschema.xml.in
diff --git a/data/Makefile.am b/data/Makefile.am
index 045fc87..d554f3f 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -9,6 +9,7 @@ gsettings_ENUM_FILES = $(api_DATA)
gsettings_SCHEMAS = \
org.gnome.settings-daemon.peripherals.gschema.xml \
org.gnome.settings-daemon.plugins.gschema.xml \
+ org.gnome.settings-daemon.plugins.keyboard.gschema.xml \
org.gnome.settings-daemon.plugins.media-keys.gschema.xml \
org.gnome.settings-daemon.plugins.xsettings.gschema.xml \
org.gnome.settings-daemon.plugins.housekeeping.gschema.xml \
diff --git a/data/org.gnome.settings-daemon.plugins.keyboard.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.keyboard.gschema.xml.in.in
new file mode 100644
index 0000000..f95caab
--- /dev/null
+++ b/data/org.gnome.settings-daemon.plugins.keyboard.gschema.xml.in.in
@@ -0,0 +1,14 @@
+<schemalist>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.plugins.keyboard" path="/apps/gnome-settings-daemon/plugins/keyboard/">
+ <key name="disable-indicator" type="b">
+ <default>false</default>
+ <_summary>Never show indicator</_summary>
+ <_description>Disable the keyboard layout indicator unconditionally, do not show it even if number of layouts is more than one</_description>
+ </key>
+ <key name="duplicate-leds" type="b">
+ <default>false</default>
+ <_summary>Display keyboard indicators on the panel</_summary>
+ <_description>Display pseudo-leds for keyboards that do not have physical LEDs for CapsLock, NumLock, ScrollLock</_description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/plugins/keyboard/gsd-keyboard-xkb.c b/plugins/keyboard/gsd-keyboard-xkb.c
index 747cd94..0262891 100644
--- a/plugins/keyboard/gsd-keyboard-xkb.c
+++ b/plugins/keyboard/gsd-keyboard-xkb.c
@@ -41,6 +41,7 @@
#include "gnome-settings-profile.h"
#define GTK_RESPONSE_PRINT 2
+#define SETTINGS_KEYBOARD_DIR "org.gnome.settings-daemon.peripherals.mouse"
static GsdKeyboardManager *manager = NULL;
@@ -55,17 +56,16 @@ static GkbdKeyboardConfig initial_sys_kbd_config;
static gboolean inited_ok = FALSE;
+static GSettings *settings_plugin = NULL;
static GSettings *settings_desktop = NULL;
static GSettings *settings_keyboard = NULL;
static PostActivationCallback pa_callback = NULL;
static void *pa_callback_user_data = NULL;
-static const char DISABLE_INDICATOR_KEY[] =
- "/desktop/gnome/peripherals/keyboard/general/disable_indicator";
+static const char DISABLE_INDICATOR_KEY[] = "disable-indicator";
-static const char DUPLICATE_LEDS_KEY[] =
- "/desktop/gnome/peripherals/keyboard/general/duplicate_leds";
+static const char DUPLICATE_LEDS_KEY[] = "duplicate-leds";
static const char *gdm_keyboard_layout = NULL;
@@ -161,7 +161,6 @@ activation_error (void)
static void
apply_desktop_settings (void)
{
- GConfClient *conf_client;
gboolean show_leds;
int i;
if (!inited_ok)
@@ -173,10 +172,8 @@ apply_desktop_settings (void)
before activating them */
gkbd_desktop_config_activate (¤t_config);
- conf_client = gconf_client_get_default ();
show_leds =
- gconf_client_get_bool (conf_client, DUPLICATE_LEDS_KEY, NULL);
- g_object_unref (conf_client);
+ g_settings_get_boolean (settings_plugin, DUPLICATE_LEDS_KEY);
for (i = sizeof (indicator_icons) / sizeof (indicator_icons[0]);
--i >= 0;) {
gtk_status_icon_set_visible (indicator_icons[i],
@@ -335,13 +332,9 @@ show_hide_icon ()
{
if (g_strv_length (current_kbd_config.layouts_variants) > 1) {
if (icon == NULL) {
- GConfClient *conf_client =
- gconf_client_get_default ();
gboolean disable =
- gconf_client_get_bool (conf_client,
- DISABLE_INDICATOR_KEY,
- NULL);
- g_object_unref (conf_client);
+ g_settings_get_boolean (settings_plugin,
+ DISABLE_INDICATOR_KEY);
if (disable)
return;
@@ -686,6 +679,8 @@ gsd_keyboard_xkb_init (GsdKeyboardManager * kbd_manager)
GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
gnome_settings_profile_start (NULL);
+ settings_plugin = g_settings_new (SETTINGS_KEYBOARD_DIR);
+
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
DATADIR G_DIR_SEPARATOR_S
"icons");
@@ -792,6 +787,8 @@ gsd_keyboard_xkb_shutdown (void)
settings_desktop = NULL;
g_object_unref (settings_keyboard);
settings_keyboard = NULL;
+ g_object_unref (settings_plugin);
+ settings_plugin = NULL;
if (xkl_registry) {
g_object_unref (xkl_registry);
diff --git a/plugins/keyboard/gsd-keyboard-xkb.h b/plugins/keyboard/gsd-keyboard-xkb.h
index eaca560..c5ac24c 100644
--- a/plugins/keyboard/gsd-keyboard-xkb.h
+++ b/plugins/keyboard/gsd-keyboard-xkb.h
@@ -24,9 +24,6 @@
#ifndef __GSD_KEYBOARD_XKB_H
#define __GSD_KEYBOARD_XKB_H
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
#include <libxklavier/xklavier.h>
#include "gsd-keyboard-manager.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]