return NULL when there is an error, not exit(), so that we do proper

2007-04-02  Rodrigo Moya <rodrigo@gnome-db.org>

	* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
	when there is an error, not exit(), so that we do proper cleanup.
	Remove code to register GConf callbacks, that is done in utils.c.
	(gnome_settings_daemon_get_conf_client,
	gnome_settings_daemon_register_callback,
	 gnome_settings_daemon_spawn_with_input,
	 gnome_settings_daemon_get_invisible,
	 gnome_settings_daemon_delayed_show_dialog): removed from the
	GnomeSettingsDaemon interface.

	* utils.c (gnome_settings_get_config_client,
	 gnome_settings_get_invisible,
	 gnome_settings_register_config_callback,
	 gnome_settings_spawn_with_input,
	 gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
	interface.

	* factory.c (main): check return value from gnome_settings_daemon().

	* *.c: adapted to changes in function names.

	* Makefile.am: put source files in alphabetical order.

svn path=/trunk/; revision=7434
This commit is contained in:
Rodrigo Moya 2007-04-02 15:27:35 +00:00 committed by Rodrigo Moya
parent 23e6f1e2a7
commit e16cbd24dc
20 changed files with 233 additions and 430 deletions

View file

@ -1,3 +1,28 @@
2007-04-02 Rodrigo Moya <rodrigo@gnome-db.org>
* gnome-settings-daemon.c (gnome_settings_daemon_new): return NULL
when there is an error, not exit(), so that we do proper cleanup.
Remove code to register GConf callbacks, that is done in utils.c.
(gnome_settings_daemon_get_conf_client,
gnome_settings_daemon_register_callback,
gnome_settings_daemon_spawn_with_input,
gnome_settings_daemon_get_invisible,
gnome_settings_daemon_delayed_show_dialog): removed from the
GnomeSettingsDaemon interface.
* utils.c (gnome_settings_get_config_client,
gnome_settings_get_invisible,
gnome_settings_register_config_callback,
gnome_settings_spawn_with_input,
gnome_settings_delayed_show_dialog): moved from GnomeSettingsDaemon
interface.
* factory.c (main): check return value from gnome_settings_daemon().
* *.c: adapted to changes in function names.
* Makefile.am: put source files in alphabetical order.
2007-03-29 Priit Laes <amd@store20.com>
* gnome-settings-multimedia-keys.c: (get_term_command), (execute),

View file

@ -16,63 +16,65 @@ INCLUDES= \
libexec_PROGRAMS=gnome-settings-daemon
gnome_settings_daemon_SOURCES = \
factory.c \
clipboard-manager.c \
clipboard-manager.h \
delayed-dialog.c \
eggaccelerators.h \
eggaccelerators.c \
factory.c \
gnome-settings-accessibility-keyboard.h \
gnome-settings-accessibility-keyboard.c \
gnome-settings-background.h \
gnome-settings-background.c \
gnome-settings-daemon.h \
gnome-settings-daemon.c \
gnome-settings-dbus.c \
gnome-settings-dbus.h \
gnome-settings-default-editor.c \
gnome-settings-default-editor.h \
gnome-settings-font.h \
gnome-settings-font.c \
gnome-settings-mouse.h \
gnome-settings-mouse.c \
gnome-settings-multimedia-keys.h \
gnome-settings-multimedia-keys.c \
gnome-settings-gtk1theme.c \
gnome-settings-gtk1theme.h \
gnome-settings-keybindings.c \
gnome-settings-keybindings.h \
gnome-settings-keyboard-xkb.h \
gnome-settings-keyboard-xkb.c \
gnome-settings-keyboard.h \
gnome-settings-keyboard.c \
gnome-settings-background.h \
gnome-settings-background.c \
gnome-settings-xsettings.c \
gnome-settings-xsettings.h \
gnome-settings-locate-pointer.c \
gnome-settings-locate-pointer.h \
gnome-settings-sound.c \
gnome-settings-sound.h \
gnome-settings-accessibility-keyboard.h \
gnome-settings-accessibility-keyboard.c \
gnome-settings-mouse.h \
gnome-settings-mouse.c \
gnome-settings-multimedia-keys.h \
gnome-settings-multimedia-keys.c \
gnome-settings-screensaver.h \
gnome-settings-screensaver.c \
gnome-settings-default-editor.c \
gnome-settings-default-editor.h \
gnome-settings-gtk1theme.c \
gnome-settings-gtk1theme.h \
gnome-settings-server.h \
gnome-settings-dbus.c \
gnome-settings-dbus.h \
gnome-settings-xrdb.c \
gnome-settings-xrdb.h \
gsd-media-keys-window.c \
gsd-media-keys-window.h \
xsettings-common.c \
xsettings-manager.c \
xsettings-common.h \
xsettings-manager.h \
gnome-settings-keybindings.c \
gnome-settings-keybindings.h \
gnome-settings-sound.c \
gnome-settings-sound.h \
gnome-settings-typing-break.c \
gnome-settings-typing-break.h \
reaper.c \
reaper.h \
gnome-settings-xmodmap.c \
gnome-settings-xmodmap.h \
gnome-settings-xrdb.c \
gnome-settings-xrdb.h \
gnome-settings-xsettings.c \
gnome-settings-xsettings.h \
gsd-media-keys-window.c \
gsd-media-keys-window.h \
list.c \
list.h \
reaper.c \
reaper.h \
utils.c \
utils.h \
xsettings-common.c \
xsettings-common.h \
xsettings-manager.c \
xsettings-manager.h \
xutils.c \
xutils.h \
clipboard-manager.c \
clipboard-manager.h \
delayed-dialog.c
xutils.h
# $(AccessX_files)

View file

@ -17,6 +17,7 @@ int main (int argc, char *argv [])
{
GnomeProgram *program;
GnomeClient *session;
GnomeSettingsDaemon *settings_daemon;
gchar *restart_argv[] = { "gnome-settings-daemon", NULL, NULL };
restart_argv[1] = *argv;
@ -33,7 +34,8 @@ int main (int argc, char *argv [])
gconf_init (argc, argv, NULL); /* exits w/ message on failure */
gnome_settings_daemon_new ();
if (!(settings_daemon = gnome_settings_daemon_new ()))
return 1;
session = gnome_master_client ();
gnome_client_set_restart_command (session, 2, restart_argv);
@ -42,13 +44,14 @@ int main (int argc, char *argv [])
g_signal_connect (session, "die",
G_CALLBACK (gtk_main_quit), NULL);
gtk_main();
gtk_main ();
/* cleanup */
g_object_unref (program);
g_object_unref (settings_daemon);
if (conf_client)
g_object_unref (conf_client);
g_object_unref (program);
return -1;
}

View file

@ -162,7 +162,7 @@ set_server_from_gconf (GConfEntry *ignored)
{
XkbDescRec *desc;
gboolean enable_accessX;
GConfClient *client = gnome_settings_daemon_get_conf_client ();
GConfClient *client = gnome_settings_get_config_client ();
desc = get_xkb_desc_rec ();
if (!desc) {
@ -299,7 +299,7 @@ ax_response_callback (gint response_id, guint revert_controls_mask, gboolean ena
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_CANCEL:
{
GConfClient *client = gnome_settings_daemon_get_conf_client ();
GConfClient *client = gnome_settings_get_config_client ();
/* we're reverting, so we invert sense of 'enabled' flag */
d ("cancelling AccessX request");
@ -433,7 +433,7 @@ static void
set_gconf_from_server (GConfEntry *ignored)
{
gboolean in_gconf;
GConfClient *client = gnome_settings_daemon_get_conf_client ();
GConfClient *client = gnome_settings_get_config_client ();
GConfChangeSet *cs = gconf_change_set_new ();
XkbDescRec *desc = get_xkb_desc_rec ();
gboolean changed = FALSE, slowkeys_changed, stickykeys_changed;
@ -590,7 +590,7 @@ gnome_settings_accessibility_keyboard_load (GConfClient *client)
void
gnome_settings_accessibility_keyboard_init (GConfClient *client)
{
gnome_settings_daemon_register_callback (CONFIG_ROOT, &set_server_from_gconf);
gnome_settings_register_config_callback (CONFIG_ROOT, &set_server_from_gconf);
}
#else

View file

@ -89,7 +89,7 @@ gnome_settings_background_init (GConfClient *client)
prefs = BG_PREFERENCES (bg_preferences_new ());
bg_preferences_load (prefs);
gnome_settings_daemon_register_callback ("/desktop/gnome/background", background_callback);
gnome_settings_register_config_callback ("/desktop/gnome/background", background_callback);
}
void

View file

@ -21,9 +21,6 @@
* Authors: Owen Taylor, Havoc Pennington
*/
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
@ -33,11 +30,6 @@
#include <libgnome/gnome-init.h>
#include <libgnomeui/gnome-ui-init.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include "xsettings-manager.h"
#include "gnome-settings-daemon.h"
#include "gnome-settings-xmodmap.h"
@ -67,76 +59,9 @@ struct _GnomeSettingsDaemonPrivate {
int dummy;
};
static GSList *directories = NULL;
XSettingsManager **managers = NULL;
static ClipboardManager *clipboard_manager;
typedef struct DirElement
{
char *dir;
GSList *callbacks;
} DirElement;
void
gnome_settings_daemon_register_callback (const char *dir,
KeyCallbackFunc func)
{
GSList *list;
gboolean dir_found = FALSE;
for (list = directories; list; list = list->next)
{
DirElement *dir_element = list->data;
if (! strcmp (dir_element->dir, dir))
{
dir_element->callbacks = g_slist_prepend (dir_element->callbacks, (gpointer)func);
dir_found = TRUE;
break;
}
}
if (! dir_found)
{
DirElement *dir_element = g_new0 (DirElement, 1);
dir_element->dir = g_strdup (dir);
dir_element->callbacks = g_slist_prepend (dir_element->callbacks, (gpointer)func);
directories = g_slist_prepend (directories, dir_element);
}
}
GtkWidget *
gnome_settings_daemon_get_invisible (void)
{
static GtkWidget *invisible = NULL;
if (invisible == NULL)
invisible = gtk_invisible_new ();
return invisible;
}
static void
config_notify (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
gpointer user_data)
{
GSList *list;
for (list = directories; list; list = list->next)
{
DirElement *dir_element = list->data;
if (! strncmp (dir_element->dir, entry->key, strlen (dir_element->dir)))
{
GSList *func_list;
for (func_list = dir_element->callbacks; func_list; func_list = func_list->next)
{
((KeyCallbackFunc) func_list->data) (entry);
}
}
}
}
static void
clipboard_manager_terminate_cb (void *data)
{
@ -274,19 +199,16 @@ gnome_settings_daemon_new (void)
if (xsettings_manager_check_running (
gdk_x11_display_get_xdisplay (display),
gdk_screen_get_number (gdk_screen_get_default ())))
{
gdk_screen_get_number (gdk_screen_get_default ()))) {
fprintf (stderr, "You can only run one xsettings manager at a time; exiting\n");
exit (1);
return NULL;
}
if (!terminated)
{
if (!terminated) {
managers = g_new (XSettingsManager *, n_screens + 1);
for (i = 0; i < n_screens; i++)
{
for (i = 0; i < n_screens; i++) {
GdkScreen *screen;
screen = gdk_display_get_screen (display, i);
@ -295,10 +217,9 @@ gnome_settings_daemon_new (void)
gdk_x11_display_get_xdisplay (display),
gdk_screen_get_number (screen),
terminate_cb, &terminated);
if (!managers [i])
{
if (!managers [i]) {
fprintf (stderr, "Could not create xsettings manager for screen %d!\n", i);
exit (1);
return NULL;
}
}
@ -306,8 +227,7 @@ gnome_settings_daemon_new (void)
managers [i] = NULL;
}
if (!clipboard_manager_check_running (GDK_DISPLAY_XDISPLAY (display)))
{
if (!clipboard_manager_check_running (GDK_DISPLAY_XDISPLAY (display))) {
clipboard_manager = clipboard_manager_new (GDK_DISPLAY_XDISPLAY (display),
gdk_error_trap_push,
gdk_error_trap_pop,
@ -316,21 +236,18 @@ gnome_settings_daemon_new (void)
NULL);
}
/* We use GConfClient not GConfClient because a cache isn't useful
* for us
*/
client = gnome_settings_daemon_get_conf_client ();
client = gnome_settings_get_config_client ();
/* gnome_settings_disk_init (client);*/
/* gnome_settings_disk_init (client);*/
gnome_settings_font_init (client);
gnome_settings_xsettings_init (client);
gnome_settings_mouse_init (client);
/* Essential - xkb initialization should happen before */
/* Essential - xkb initialization should happen before */
gnome_settings_keyboard_xkb_set_post_activation_callback ((PostActivationCallback)gnome_settings_load_modmap_files, NULL);
gnome_settings_keyboard_xkb_init (client);
gnome_settings_keyboard_init (client);
gnome_settings_multimedia_keys_init (client);
/* */
/* */
gnome_settings_sound_init (client);
gnome_settings_accessibility_keyboard_init (client);
gnome_settings_screensaver_init (client);
@ -341,33 +258,7 @@ gnome_settings_daemon_new (void)
gnome_settings_xrdb_init (client);
gnome_settings_typing_break_init (client);
for (list = directories; list; list = list->next)
{
GError *error = NULL;
DirElement *dir_element = list->data;
gconf_client_add_dir (client,
dir_element->dir,
GCONF_CLIENT_PRELOAD_ONELEVEL,
NULL);
gconf_client_notify_add (client,
dir_element->dir,
config_notify,
NULL,
NULL,
&error);
if (error)
{
fprintf (stderr, "Could not listen for changes to configuration in '%s': %s\n",
dir_element->dir, error->message);
g_error_free (error);
}
}
for (i = 0; i < n_screens; i++)
{
for (i = 0; i < n_screens; i++) {
GdkScreen *screen;
screen = gdk_display_get_screen (display, i);
@ -376,15 +267,15 @@ gnome_settings_daemon_new (void)
manager_event_filter, GINT_TO_POINTER (i));
}
/* gnome_settings_disk_load (client);*/
/* gnome_settings_disk_load (client);*/
gnome_settings_font_load (client);
gnome_settings_xsettings_load (client);
gnome_settings_mouse_load (client);
/* Essential - xkb initialization should happen before */
/* Essential - xkb initialization should happen before */
gnome_settings_keyboard_xkb_load (client);
gnome_settings_keyboard_load (client);
gnome_settings_multimedia_keys_load (client);
/* */
/* */
gnome_settings_sound_load (client);
gnome_settings_accessibility_keyboard_load (client);
gnome_settings_screensaver_load (client);
@ -399,107 +290,3 @@ gnome_settings_daemon_new (void)
return G_OBJECT (daemon);
}
/* Helper functions */
static void
child_watch_cb (GPid pid, gint status, gpointer user_data)
{
gchar *command = user_data;
if (!WIFEXITED (status) || WEXITSTATUS (status))
{
g_warning ("Command %s failed", command);
}
g_free (command);
}
/*
* Helper function for spawn_with_input() - write an entire
* string to a fd.
*/
static gboolean
write_all (int fd,
const char *buf,
gsize to_write)
{
while (to_write > 0)
{
gssize count = write (fd, buf, to_write);
if (count < 0)
{
if (errno != EINTR)
return FALSE;
}
else
{
to_write -= count;
buf += count;
}
}
return TRUE;
}
/**
* gnome_settings_daemon-spawn_with_input:
* @argv: command line to run
* @input: string to write to the child process.
*
* Spawns a child process specified by @argv, writes the text in
* @input to it, then waits for the child to exit. Any failures
* are output through g_warning(); if you wanted to use this in
* cases where errors need to be presented to the user, some
* modification would be needed.
**/
void
gnome_settings_daemon_spawn_with_input (char **argv,
const char *input)
{
int child_pid;
int inpipe;
GError *err = NULL;
gchar *command;
if (!g_spawn_async_with_pipes (NULL /* working directory */, argv, NULL /* envp */,
G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
NULL, NULL, /* child setup and data */
&child_pid,
&inpipe, NULL, NULL, /* stdin, stdout, stderr */
&err))
{
command = g_strjoinv (" ", argv);
g_warning ("Could not execute %s: %s", command, err->message);
g_error_free (err);
g_free (command);
return;
}
command = g_strjoinv (" ", argv);
if (input)
{
if (!write_all (inpipe, input, strlen (input)))
{
g_warning ("Could not write input to %s", command);
}
close (inpipe);
}
g_child_watch_add (child_pid, (GChildWatchFunc) child_watch_cb, command);
}
extern GConfClient *conf_client;
GConfClient *
gnome_settings_daemon_get_conf_client (void)
{
if (!conf_client)
conf_client = gconf_client_get_default ();
return conf_client;
}

View file

@ -25,18 +25,8 @@
#define __GNOME_SETTINGS_DAEMON_H
#include <gtk/gtk.h>
#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
#include <bonobo/bonobo-object.h>
typedef void (* KeyCallbackFunc) (GConfEntry *entry);
void gnome_settings_daemon_register_callback (const char *dir,
KeyCallbackFunc func);
GtkWidget *gnome_settings_daemon_get_invisible (void);
void gnome_settings_delayed_show_dialog (GtkWidget *dialog);
#include "utils.h"
G_BEGIN_DECLS
@ -51,23 +41,17 @@ typedef struct _GnomeSettingsDaemon GnomeSettingsDaemon;
typedef struct _GnomeSettingsDaemonClass GnomeSettingsDaemonClass;
typedef struct _GnomeSettingsDaemonPrivate GnomeSettingsDaemonPrivate;
struct _GnomeSettingsDaemon
{
struct _GnomeSettingsDaemon {
GObject parent_instance;
GnomeSettingsDaemonPrivate *private;
};
struct _GnomeSettingsDaemonClass
{
struct _GnomeSettingsDaemonClass {
GObjectClass parent_class;
};
GType gnome_settings_daemon_get_type (void);
GObject *gnome_settings_daemon_new (void);
void gnome_settings_daemon_spawn_with_input (char **argv,
const char *input);
GConfClient *gnome_settings_daemon_get_conf_client (void);
/**
* DBUS server

View file

@ -125,7 +125,7 @@ gnome_settings_default_editor_init (GConfClient *client)
{
sync_changes = gconf_client_get_bool (client, SYNC_CHANGES_KEY, NULL);
gnome_settings_daemon_register_callback (SYNC_CHANGES_KEY, sync_changes_cb);
gnome_settings_register_config_callback (SYNC_CHANGES_KEY, sync_changes_cb);
g_signal_connect (gnome_vfs_mime_monitor_get (), "data_changed",
G_CALLBACK (vfs_change_cb), client);

View file

@ -39,7 +39,7 @@ load_xcursor_theme (GConfClient *client)
g_string_append_printf (add_string,
"Xcursor.size: %d\n", size);
gnome_settings_daemon_spawn_with_input (add, add_string->str);
gnome_settings_spawn_with_input (add, add_string->str);
g_free (cursor_theme);
g_string_free (add_string, TRUE);

View file

@ -146,7 +146,7 @@ check_filename (char *base_dir,
static void
apply_settings (void)
{
GConfClient *client = gnome_settings_daemon_get_conf_client ();
GConfClient *client = gnome_settings_get_config_client ();
gchar *current_theme;
gchar *theme_filename;
gchar *rc_filename;
@ -211,7 +211,8 @@ apply_settings (void)
void
gnome_settings_gtk1_theme_init (GConfClient *client)
{
gnome_settings_daemon_register_callback (GTK_THEME_KEY, (KeyCallbackFunc) apply_settings);
gnome_settings_register_config_callback (GTK_THEME_KEY,
(GnomeSettingsConfigCallback) apply_settings);
}
void

View file

@ -187,7 +187,7 @@ bindings_get_entry (const char *subdir)
char *action = NULL;
char *key = NULL;
gboolean ret = FALSE;
GConfClient *client = gnome_settings_daemon_get_conf_client ();
GConfClient *client = gnome_settings_get_config_client ();
g_return_val_if_fail (subdir != NULL, FALSE);
@ -465,7 +465,7 @@ gnome_settings_keybindings_init (GConfClient *client)
int screen_num = gdk_display_get_n_screens (dpy);
int i;
gnome_settings_daemon_register_callback (GCONF_BINDING_DIR, bindings_callback);
gnome_settings_register_config_callback (GCONF_BINDING_DIR, bindings_callback);
for (i = 0; i < screen_num; i++)
{

View file

@ -149,7 +149,7 @@ apply_xkb_settings (void)
if (!inited_ok)
return;
conf_client = gnome_settings_daemon_get_conf_client ();
conf_client = gnome_settings_get_config_client ();
gkbd_keyboard_config_init (&current_sys_kbd_config, conf_client,
xkl_engine);
@ -191,7 +191,7 @@ gnome_settings_keyboard_xkb_sysconfig_changed_response (GtkDialog * dialog,
(G_OBJECT (dialog),
"chkDontShowAgain")));
conf_client = gnome_settings_daemon_get_conf_client ();
conf_client = gnome_settings_get_config_client ();
switch (what2do) {
case RESPONSE_USE_X:
@ -221,7 +221,7 @@ gnome_settings_keyboard_xkb_analyze_sysconfig (void)
if (!inited_ok)
return;
conf_client = gnome_settings_daemon_get_conf_client ();
conf_client = gnome_settings_get_config_client ();
gkbd_keyboard_config_init (&backup_gconf_kbd_config, conf_client,
xkl_engine);
gkbd_keyboard_config_init (&initial_sys_kbd_config, conf_client,
@ -314,7 +314,7 @@ gnome_settings_chk_file_list (void)
GSList *tmp_l = NULL;
gboolean new_file_exist = FALSE;
GConfClient *conf_client =
gnome_settings_daemon_get_conf_client ();
gnome_settings_get_config_client ();
home_dir = g_dir_open (g_get_home_dir (), 0, NULL);
while ((fname = g_dir_read_name (home_dir)) != NULL) {
@ -405,13 +405,13 @@ gnome_settings_keyboard_xkb_init (GConfClient * client)
gnome_settings_keyboard_xkb_analyze_sysconfig ();
gnome_settings_keyboard_xkb_chk_lcl_xmm ();
gnome_settings_daemon_register_callback
gnome_settings_register_config_callback
(GKBD_DESKTOP_CONFIG_DIR,
(KeyCallbackFunc) apply_settings);
(GnomeSettingsConfigCallback) apply_settings);
gnome_settings_daemon_register_callback
gnome_settings_register_config_callback
(GKBD_KEYBOARD_CONFIG_DIR,
(KeyCallbackFunc) apply_xkb_settings);
(GnomeSettingsConfigCallback) apply_xkb_settings);
gdk_window_add_filter (NULL, (GdkFilterFunc)
gnome_settings_keyboard_xkb_evt_filter,

View file

@ -168,7 +168,7 @@ numlock_get_gconf_state (void)
GError *err = NULL;
char *key = numlock_gconf_state_key ();
if (!key) return NUMLOCK_STATE_UNKNOWN;
gcc = gnome_settings_daemon_get_conf_client ();
gcc = gnome_settings_get_config_client ();
curr_state = gconf_client_get_bool (gcc, key, &err);
if (err) curr_state = NUMLOCK_STATE_UNKNOWN;
g_clear_error (&err);
@ -185,7 +185,7 @@ numlock_set_gconf_state (gboolean new_state)
return;
key = numlock_gconf_state_key ();
if (!key) return;
gcc = gnome_settings_daemon_get_conf_client ();
gcc = gnome_settings_get_config_client ();
gconf_client_set_bool (gcc, key, new_state, NULL);
g_free (key);
}
@ -253,7 +253,7 @@ apply_settings (void)
XKeyboardControl kbdcontrol;
client = gnome_settings_daemon_get_conf_client ();
client = gnome_settings_get_config_client ();
repeat = gconf_client_get_bool (client, "/desktop/gnome/peripherals/keyboard/repeat", NULL);
click = gconf_client_get_bool (client, "/desktop/gnome/peripherals/keyboard/click", NULL);
@ -320,7 +320,7 @@ apply_settings (void)
void
gnome_settings_keyboard_init (GConfClient *client)
{
gnome_settings_daemon_register_callback (GSD_KEYBOARD_KEY, (KeyCallbackFunc) apply_settings);
gnome_settings_register_config_callback (GSD_KEYBOARD_KEY, (GnomeSettingsConfigCallback) apply_settings);
#ifdef HAVE_X11_EXTENSIONS_XKB_H
numlock_install_xkb_callback ();
#endif /* HAVE_X11_EXTENSIONS_XKB_H */

View file

@ -465,7 +465,7 @@ mouse_callback (GConfEntry *entry)
void
gnome_settings_mouse_init (GConfClient *client)
{
gnome_settings_daemon_register_callback ("/desktop/gnome/peripherals/mouse", mouse_callback);
gnome_settings_register_config_callback ("/desktop/gnome/peripherals/mouse", mouse_callback);
}

View file

@ -62,7 +62,7 @@ key_toggled_cb (GtkWidget *toggle, gpointer data)
{
GConfClient *client;
client = gnome_settings_daemon_get_conf_client ();
client = gnome_settings_get_config_client ();
gconf_client_set_bool (client,
SHOW_STARTUP_ERRORS_KEY,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))
@ -96,7 +96,7 @@ really_start_screensaver (gpointer user_data)
if (g_spawn_command_line_async (ss_command, &gerr))
return FALSE;
client = gnome_settings_daemon_get_conf_client ();
client = gnome_settings_get_config_client ();
show_error = gconf_client_get_bool (client, SHOW_STARTUP_ERRORS_KEY, NULL);
if (!show_error) {
g_error_free (gerr);

View file

@ -156,7 +156,7 @@ apply_settings (void)
struct reload_foreach_closure closure;
client = gnome_settings_daemon_get_conf_client ();
client = gnome_settings_get_config_client ();
#ifdef HAVE_ESD
enable_sound = gconf_client_get_bool (client, "/desktop/gnome/sound/enable_esd", NULL);
@ -203,7 +203,8 @@ apply_settings (void)
void
gnome_settings_sound_init (GConfClient *client)
{
gnome_settings_daemon_register_callback ("/desktop/gnome/sound", (KeyCallbackFunc) apply_settings);
gnome_settings_register_config_callback ("/desktop/gnome/sound",
(GnomeSettingsConfigCallback) apply_settings);
}
void

View file

@ -85,7 +85,7 @@ gnome_settings_typing_break_init (GConfClient *client)
reaper = vte_reaper_get();
g_signal_connect (reaper, "child_exited", G_CALLBACK (child_exited_callback), NULL);
gnome_settings_daemon_register_callback ("/desktop/gnome/typing_break", typing_break_callback);
gnome_settings_register_config_callback ("/desktop/gnome/typing_break", typing_break_callback);
}
static gboolean

View file

@ -44,7 +44,7 @@ static void
check_button_callback (GtkWidget *chk_button,
gpointer data)
{
GConfClient *confClient = gnome_settings_daemon_get_conf_client ();
GConfClient *confClient = gnome_settings_get_config_client ();
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_button))) {
gconf_client_set_bool (confClient, DISABLE_XMM_WARNING_KEY, TRUE,
@ -59,7 +59,7 @@ check_button_callback (GtkWidget *chk_button,
void
gnome_settings_load_modmap_files (void)
{
GConfClient *confClient = gnome_settings_daemon_get_conf_client ();
GConfClient *confClient = gnome_settings_get_config_client ();
GSList *tmp = NULL;
GSList *loaded_file_list = gconf_client_get_list (confClient, LOADED_FILES_KEY, GCONF_VALUE_STRING, NULL);
tmp = loaded_file_list;
@ -155,7 +155,7 @@ remove_button_clicked_callback (GtkWidget *button,
return;
/* Remove the selected file */
confClient = gnome_settings_daemon_get_conf_client ();
confClient = gnome_settings_get_config_client ();
loaded_files = gconf_client_get_list (confClient, LOADED_FILES_KEY, GCONF_VALUE_STRING, NULL);
loaded_files = remove_string_from_list (loaded_files, (char *)filenames->data);
@ -206,7 +206,7 @@ load_button_clicked_callback (GtkWidget *button,
/* Add the files to left-tree-view */
confClient = gnome_settings_daemon_get_conf_client ();
confClient = gnome_settings_get_config_client ();
loaded_files = gconf_client_get_list (confClient, LOADED_FILES_KEY, GCONF_VALUE_STRING, NULL);
tmp = loaded_files;
while (tmp != NULL) {
@ -259,7 +259,7 @@ gnome_settings_modmap_dialog_call (void)
GDir *homeDir;
GSList *loaded_files = NULL;
G_CONST_RETURN gchar *fname;
GConfClient *confClient = gnome_settings_daemon_get_conf_client ();
GConfClient *confClient = gnome_settings_get_config_client ();
homeDir = g_dir_open (g_get_home_dir (), 0, NULL);
if (homeDir == NULL)
return;

View file

@ -314,7 +314,7 @@ apply_settings (GtkStyle *style)
error = NULL;
}
gnome_settings_daemon_spawn_with_input (xrdb, string->str);
gnome_settings_spawn_with_input (xrdb, string->str);
g_string_free (string, TRUE);
return;
}

View file

@ -254,12 +254,12 @@ xsettings_callback (GConfEntry *entry)
void
gnome_settings_xsettings_init (GConfClient *client)
{
gnome_settings_daemon_register_callback ("/desktop/gnome/peripherals/mouse", xsettings_callback);
gnome_settings_daemon_register_callback ("/desktop/gtk", xsettings_callback);
gnome_settings_daemon_register_callback ("/desktop/gnome/interface", xsettings_callback);
gnome_settings_register_config_callback ("/desktop/gnome/peripherals/mouse", xsettings_callback);
gnome_settings_register_config_callback ("/desktop/gtk", xsettings_callback);
gnome_settings_register_config_callback ("/desktop/gnome/interface", xsettings_callback);
#ifdef HAVE_XFT2
gnome_settings_daemon_register_callback (FONT_RENDER_DIR, xft_callback);
gnome_settings_register_config_callback (FONT_RENDER_DIR, xft_callback);
#endif /* HAVE_XFT2 */
}
@ -270,7 +270,7 @@ xft_callback (GConfEntry *entry)
GConfClient *client;
int i;
client = gnome_settings_daemon_get_conf_client ();
client = gnome_settings_get_config_client ();
gnome_settings_update_xft (client);
@ -478,7 +478,7 @@ gnome_xft_settings_set_xresources (GnomeXftSettings *settings)
g_string_append_printf (add_string,
"Xft.rgba: %s\n", settings->rgba);
gnome_settings_daemon_spawn_with_input (add, add_string->str);
gnome_settings_spawn_with_input (add, add_string->str);
g_string_free (add_string, TRUE);
setlocale (LC_NUMERIC, old_locale);