gnome-settings-daemon r581 - in trunk: . gnome-settings-daemon plugins/a11y-keyboard plugins/keybindings plugins/keyboard plugins/mouse plugins/typing-break plugins/xrandr plugins/xsettings
- From: behdad svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-settings-daemon r581 - in trunk: . gnome-settings-daemon plugins/a11y-keyboard plugins/keybindings plugins/keyboard plugins/mouse plugins/typing-break plugins/xrandr plugins/xsettings
- Date: Mon, 3 Nov 2008 21:36:33 +0000 (UTC)
Author: behdad
Date: Mon Nov 3 21:36:33 2008
New Revision: 581
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=581&view=rev
Log:
2008-11-03 Behdad Esfahbod <behdad gnome org>
* gnome-settings-daemon/gnome-settings-manager.c (_load_file),
(gnome_settings_manager_start), (gnome_settings_manager_stop):
* gnome-settings-daemon/gnome-settings-plugin-info.c
(gnome_settings_plugin_info_set_enabled_key_name):
* plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
(register_config_callback):
* plugins/keybindings/gsd-keybindings-manager.c
(register_config_callback), (gsd_keybindings_manager_start):
* plugins/keyboard/gsd-keyboard-manager.c
(gsd_keyboard_manager_start):
* plugins/keyboard/gsd-keyboard-xkb.c (register_config_callback):
* plugins/mouse/gsd-mouse-manager.c (register_config_callback):
* plugins/typing-break/gsd-typing-break-manager.c
(gsd_typing_break_manager_start):
* plugins/xrandr/gsd-xrandr-manager.c (gsd_xrandr_manager_start):
* plugins/xsettings/gsd-xsettings-manager.c
(register_config_callback), (gnome_xsettings_manager_start):
Preload gconf dirs when feasible (bug #559167)
Modified:
trunk/ChangeLog
trunk/gnome-settings-daemon/gnome-settings-manager.c
trunk/gnome-settings-daemon/gnome-settings-plugin-info.c
trunk/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
trunk/plugins/keybindings/gsd-keybindings-manager.c
trunk/plugins/keyboard/gsd-keyboard-manager.c
trunk/plugins/keyboard/gsd-keyboard-xkb.c
trunk/plugins/mouse/gsd-mouse-manager.c
trunk/plugins/typing-break/gsd-typing-break-manager.c
trunk/plugins/xrandr/gsd-xrandr-manager.c
trunk/plugins/xsettings/gsd-xsettings-manager.c
Modified: trunk/gnome-settings-daemon/gnome-settings-manager.c
==============================================================================
--- trunk/gnome-settings-daemon/gnome-settings-manager.c (original)
+++ trunk/gnome-settings-daemon/gnome-settings-manager.c Mon Nov 3 21:36:33 2008
@@ -49,6 +49,7 @@
struct GnomeSettingsManagerPrivate
{
DBusGConnection *connection;
+ GConfClient *gconf_client;
char *settings_prefix;
GSList *plugins;
};
@@ -157,7 +158,6 @@
{
GnomeSettingsPluginInfo *info;
char *key_name;
- GConfClient *client;
int priority;
GError *error;
GSList *l;
@@ -194,9 +194,8 @@
key_name = g_strdup_printf ("%s/%s/priority",
manager->priv->settings_prefix,
gnome_settings_plugin_info_get_location (info));
- client = gconf_client_get_default ();
error = NULL;
- priority = gconf_client_get_int (client, key_name, &error);
+ priority = gconf_client_get_int (manager->priv->gconf_client, key_name, &error);
if (error == NULL) {
if (priority > 0) {
gnome_settings_plugin_info_set_priority (info, priority);
@@ -205,7 +204,6 @@
g_error_free (error);
}
g_free (key_name);
- g_object_unref (client);
out:
if (info != NULL) {
@@ -339,6 +337,15 @@
goto out;
}
+ manager->priv->gconf_client = gconf_client_get_default ();
+
+ gnome_settings_profile_start ("preloading gconf keys");
+ gconf_client_add_dir (manager->priv->gconf_client,
+ manager->priv->settings_prefix,
+ GCONF_CLIENT_PRELOAD_RECURSIVE,
+ NULL);
+ gnome_settings_profile_end ("preloading gconf keys");
+
_load_all (manager);
ret = TRUE;
@@ -373,6 +380,12 @@
#endif
_unload_all (manager);
+
+ gconf_client_remove_dir (manager->priv->gconf_client,
+ manager->priv->settings_prefix,
+ NULL);
+ g_object_unref (manager->priv->gconf_client);
+ manager->priv->gconf_client = NULL;
}
static void
Modified: trunk/gnome-settings-daemon/gnome-settings-plugin-info.c
==============================================================================
--- trunk/gnome-settings-daemon/gnome-settings-plugin-info.c (original)
+++ trunk/gnome-settings-daemon/gnome-settings-plugin-info.c Mon Nov 3 21:36:33 2008
@@ -312,15 +312,6 @@
gnome_settings_plugin_info_set_enabled_key_name (GnomeSettingsPluginInfo *info,
const char *key_name)
{
- char *dirname;
-
- dirname = g_path_get_dirname (key_name);
- if (dirname != NULL) {
- g_debug ("Monitoring dir %s for changes", dirname);
- gconf_client_add_dir (info->priv->client, dirname, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
- g_free (dirname);
- }
-
info->priv->enabled_notification_id = gconf_client_notify_add (info->priv->client,
key_name,
(GConfClientNotifyFunc)plugin_enabled_cb,
Modified: trunk/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
==============================================================================
--- trunk/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c (original)
+++ trunk/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c Mon Nov 3 21:36:33 2008
@@ -997,7 +997,7 @@
GConfClientNotifyFunc func,
guint *notify)
{
- gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_NONE, NULL);
+ gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
*notify = gconf_client_notify_add (client, path, func, manager, NULL, NULL);
}
Modified: trunk/plugins/keybindings/gsd-keybindings-manager.c
==============================================================================
--- trunk/plugins/keybindings/gsd-keybindings-manager.c (original)
+++ trunk/plugins/keybindings/gsd-keybindings-manager.c Mon Nov 3 21:36:33 2008
@@ -458,7 +458,7 @@
const char *path,
GConfClientNotifyFunc func)
{
- gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_NONE, NULL);
+ gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
return gconf_client_notify_add (client, path, func, manager, NULL, NULL);
}
@@ -477,6 +477,13 @@
g_debug ("Starting keybindings manager");
gnome_settings_profile_start (NULL);
+ client = gconf_client_get_default ();
+
+ manager->priv->notify = register_config_callback (manager,
+ client,
+ GCONF_BINDING_DIR,
+ (GConfClientNotifyFunc) bindings_callback);
+
dpy = gdk_display_get_default ();
screen_num = gdk_display_get_n_screens (dpy);
@@ -487,13 +494,6 @@
manager);
}
- client = gconf_client_get_default ();
-
- manager->priv->notify = register_config_callback (manager,
- client,
- GCONF_BINDING_DIR,
- (GConfClientNotifyFunc) bindings_callback);
-
list = gconf_client_all_dirs (client, GCONF_BINDING_DIR, NULL);
manager->priv->screens = get_screens_list ();
Modified: trunk/plugins/keyboard/gsd-keyboard-manager.c
==============================================================================
--- trunk/plugins/keyboard/gsd-keyboard-manager.c (original)
+++ trunk/plugins/keyboard/gsd-keyboard-manager.c Mon Nov 3 21:36:33 2008
@@ -59,16 +59,16 @@
#define GSD_KEYBOARD_KEY "/desktop/gnome/peripherals/keyboard"
-#define KEY_REPEAT "/desktop/gnome/peripherals/keyboard/repeat"
-#define KEY_CLICK "/desktop/gnome/peripherals/keyboard/click"
-#define KEY_RATE "/desktop/gnome/peripherals/keyboard/rate"
-#define KEY_DELAY "/desktop/gnome/peripherals/keyboard/delay"
-#define KEY_CLICK_VOLUME "/desktop/gnome/peripherals/keyboard/click_volume"
-
-#define KEY_BELL_VOLUME "/desktop/gnome/peripherals/keyboard/bell_volume"
-#define KEY_BELL_PITCH "/desktop/gnome/peripherals/keyboard/bell_pitch"
-#define KEY_BELL_DURATION "/desktop/gnome/peripherals/keyboard/bell_duration"
-#define KEY_BELL_MODE "/desktop/gnome/peripherals/keyboard/bell_mode"
+#define KEY_REPEAT GSD_KEYBOARD_KEY "/repeat"
+#define KEY_CLICK GSD_KEYBOARD_KEY "/click"
+#define KEY_RATE GSD_KEYBOARD_KEY "/rate"
+#define KEY_DELAY GSD_KEYBOARD_KEY "/delay"
+#define KEY_CLICK_VOLUME GSD_KEYBOARD_KEY "/click_volume"
+
+#define KEY_BELL_VOLUME GSD_KEYBOARD_KEY "/bell_volume"
+#define KEY_BELL_PITCH GSD_KEYBOARD_KEY "/bell_pitch"
+#define KEY_BELL_DURATION GSD_KEYBOARD_KEY "/bell_duration"
+#define KEY_BELL_MODE GSD_KEYBOARD_KEY "/bell_mode"
struct GsdKeyboardManagerPrivate
{
@@ -374,16 +374,6 @@
gdk_error_trap_pop ();
}
-static guint
-register_config_callback (GsdKeyboardManager *manager,
- GConfClient *client,
- const char *path,
- GConfClientNotifyFunc func)
-{
- gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_NONE, NULL);
- return gconf_client_notify_add (client, path, func, manager, NULL, NULL);
-}
-
gboolean
gsd_keyboard_manager_start (GsdKeyboardManager *manager,
GError **error)
@@ -397,6 +387,8 @@
manager->priv->have_xkb = 0;
client = gconf_client_get_default ();
+ gconf_client_add_dir (client, GSD_KEYBOARD_KEY, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+
/* Essential - xkb initialization should happen before */
gsd_keyboard_xkb_set_post_activation_callback ((PostActivationCallback) gsd_load_modmap_files, NULL);
gsd_keyboard_xkb_init (client);
@@ -408,10 +400,9 @@
/* apply current settings before we install the callback */
apply_settings (client, 0, NULL, manager);
- manager->priv->notify = register_config_callback (manager,
- client,
- GSD_KEYBOARD_KEY,
- (GConfClientNotifyFunc) apply_settings);
+ manager->priv->notify = gconf_client_notify_add (client, GSD_KEYBOARD_KEY,
+ (GConfClientNotifyFunc) apply_settings, manager,
+ NULL, NULL);
g_object_unref (client);
Modified: trunk/plugins/keyboard/gsd-keyboard-xkb.c
==============================================================================
--- trunk/plugins/keyboard/gsd-keyboard-xkb.c (original)
+++ trunk/plugins/keyboard/gsd-keyboard-xkb.c Mon Nov 3 21:36:33 2008
@@ -338,7 +338,7 @@
const char *path,
GConfClientNotifyFunc func)
{
- gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_NONE, NULL);
+ gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
return gconf_client_notify_add (client, path, func, NULL, NULL, NULL);
}
Modified: trunk/plugins/mouse/gsd-mouse-manager.c
==============================================================================
--- trunk/plugins/mouse/gsd-mouse-manager.c (original)
+++ trunk/plugins/mouse/gsd-mouse-manager.c Mon Nov 3 21:36:33 2008
@@ -55,12 +55,12 @@
#define GCONF_MOUSE_DIR "/desktop/gnome/peripherals/mouse"
#define GCONF_MOUSE_A11Y_DIR "/desktop/gnome/accessibility/mouse"
-#define KEY_LEFT_HANDED "/desktop/gnome/peripherals/mouse/left_handed"
-#define KEY_MOTION_ACCELERATION "/desktop/gnome/peripherals/mouse/motion_acceleration"
-#define KEY_MOTION_THRESHOLD "/desktop/gnome/peripherals/mouse/motion_threshold"
-#define KEY_LOCATE_POINTER "/desktop/gnome/peripherals/mouse/locate_pointer"
-#define KEY_DWELL_ENABLE "/desktop/gnome/accessibility/mouse/dwell_enable"
-#define KEY_DELAY_ENABLE "/desktop/gnome/accessibility/mouse/delay_enable"
+#define KEY_LEFT_HANDED GCONF_MOUSE_DIR "/left_handed"
+#define KEY_MOTION_ACCELERATION GCONF_MOUSE_DIR "/motion_acceleration"
+#define KEY_MOTION_THRESHOLD GCONF_MOUSE_DIR "/motion_threshold"
+#define KEY_LOCATE_POINTER GCONF_MOUSE_DIR "/locate_pointer"
+#define KEY_DWELL_ENABLE GCONF_MOUSE_A11Y_DIR "/dwell_enable"
+#define KEY_DELAY_ENABLE GCONF_MOUSE_A11Y_DIR "/delay_enable"
struct GsdMouseManagerPrivate
{
@@ -684,7 +684,7 @@
const char *path,
GConfClientNotifyFunc func)
{
- gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_NONE, NULL);
+ gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
return gconf_client_notify_add (client, path, func, manager, NULL, NULL);
}
Modified: trunk/plugins/typing-break/gsd-typing-break-manager.c
==============================================================================
--- trunk/plugins/typing-break/gsd-typing-break-manager.c (original)
+++ trunk/plugins/typing-break/gsd-typing-break-manager.c Mon Nov 3 21:36:33 2008
@@ -61,16 +61,6 @@
static gpointer manager_object = NULL;
-static guint
-register_config_callback (GsdTypingBreakManager *manager,
- GConfClient *client,
- const char *path,
- GConfClientNotifyFunc func)
-{
- gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_NONE, NULL);
- return gconf_client_notify_add (client, path, func, manager, NULL, NULL);
-}
-
static gboolean
typing_break_timeout (GsdTypingBreakManager *manager)
{
@@ -178,13 +168,14 @@
client = gconf_client_get_default ();
+ gconf_client_add_dir (client, GCONF_BREAK_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
manager->priv->notify =
- register_config_callback (manager,
- client,
- GCONF_BREAK_DIR,
- (GConfClientNotifyFunc) typing_break_callback);
+ gconf_client_notify_add (client,
+ GCONF_BREAK_DIR,
+ (GConfClientNotifyFunc) typing_break_callback, manager,
+ NULL, NULL);
- enabled = gconf_client_get_bool (client, "/desktop/gnome/typing_break/enabled", NULL);
+ enabled = gconf_client_get_bool (client, GCONF_BREAK_DIR "/enabled", NULL);
g_object_unref (client);
if (enabled) {
manager->priv->setup_id =
Modified: trunk/plugins/xrandr/gsd-xrandr-manager.c
==============================================================================
--- trunk/plugins/xrandr/gsd-xrandr-manager.c (original)
+++ trunk/plugins/xrandr/gsd-xrandr-manager.c Mon Nov 3 21:36:33 2008
@@ -708,7 +708,7 @@
g_assert (manager->priv->notify_id == 0);
gconf_client_add_dir (manager->priv->client, CONF_DIR,
- GCONF_CLIENT_PRELOAD_NONE,
+ GCONF_CLIENT_PRELOAD_ONELEVEL,
NULL);
manager->priv->notify_id =
Modified: trunk/plugins/xsettings/gsd-xsettings-manager.c
==============================================================================
--- trunk/plugins/xsettings/gsd-xsettings-manager.c (original)
+++ trunk/plugins/xsettings/gsd-xsettings-manager.c Mon Nov 3 21:36:33 2008
@@ -782,7 +782,6 @@
const char *path,
GConfClientNotifyFunc func)
{
- gconf_client_add_dir (client, path, GCONF_CLIENT_PRELOAD_NONE, NULL);
return gconf_client_notify_add (client, path, func, manager, NULL, NULL);
}
@@ -859,6 +858,13 @@
client = gconf_client_get_default ();
+ gconf_client_add_dir (client, MOUSE_SETTINGS_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ gconf_client_add_dir (client, GTK_SETTINGS_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ gconf_client_add_dir (client, INTERFACE_SETTINGS_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ gconf_client_add_dir (client, SOUND_SETTINGS_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ gconf_client_add_dir (client, GTK_MODULES_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ gconf_client_add_dir (client, FONT_RENDER_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+
for (i = 0; i < G_N_ELEMENTS (translations); i++) {
GConfValue *val;
GError *err;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]