summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog46
-rw-r--r--NEWS1
-rw-r--r--capplets/about-me/e-image-chooser.c2
-rw-r--r--capplets/accessibility/at-properties/at-startup-session.h3
-rw-r--r--capplets/accessibility/keyboard/accessibility-keyboard.c3
-rw-r--r--capplets/background/gnome-wp-info.c6
-rw-r--r--capplets/common/gconf-property-editor.c17
-rw-r--r--capplets/common/gnome-theme-apply.c1
-rw-r--r--capplets/default-applications/gnome-default-applications-properties.c1
-rw-r--r--capplets/keybindings/gnome-keybinding-properties.c13
-rw-r--r--capplets/keyboard/gnome-keyboard-properties.c1
-rw-r--r--capplets/mouse/gnome-mouse-properties.c28
-rw-r--r--capplets/network/gnome-network-preferences.c5
-rw-r--r--capplets/sound/sound-properties-capplet.c1
-rw-r--r--capplets/theme-switcher/gnome-theme-details.c3
-rw-r--r--capplets/theme-switcher/gnome-theme-manager.c12
-rw-r--r--capplets/ui-properties/gnome-ui-properties.c12
-rw-r--r--capplets/windows/gnome-window-properties.c4
-rw-r--r--gnome-settings-daemon/factory.c2
-rw-r--r--gnome-settings-daemon/gnome-settings-accessibility-keyboard.c12
-rw-r--r--gnome-settings-daemon/gnome-settings-background.c18
-rw-r--r--gnome-settings-daemon/gnome-settings-daemon.c9
-rw-r--r--gnome-settings-daemon/gnome-settings-daemon.h2
-rw-r--r--gnome-settings-daemon/gnome-settings-font.c10
-rw-r--r--gnome-settings-daemon/gnome-settings-keybindings.c6
-rw-r--r--gnome-settings-daemon/gnome-settings-keybindings.h2
-rw-r--r--gnome-settings-daemon/gnome-settings-keyboard-xkb.c4
-rw-r--r--gnome-settings-daemon/gnome-settings-keyboard.c1
-rw-r--r--gnome-settings-daemon/gnome-settings-locate-pointer.h2
-rw-r--r--gnome-settings-daemon/gnome-settings-mouse.c9
-rw-r--r--gnome-settings-daemon/gnome-settings-multimedia-keys.c5
-rw-r--r--gnome-settings-daemon/gnome-settings-screensaver.c4
-rw-r--r--gnome-settings-daemon/gnome-settings-sound.c7
-rw-r--r--gnome-settings-daemon/gnome-settings-xmodmap.c16
-rw-r--r--gnome-settings-daemon/gnome-settings-xrdb.c3
-rw-r--r--gnome-settings-daemon/gnome-settings-xsettings.c6
-rw-r--r--libbackground/applier.c1
-rw-r--r--libbackground/applier.h1
-rw-r--r--libbackground/preferences.c13
-rw-r--r--libwindow-settings/gnome-wm-manager.c2
-rw-r--r--libwindow-settings/metacity-window-manager.c2
-rw-r--r--typing-break/drw-break-window.c15
-rw-r--r--typing-break/drw-utils.h2
-rw-r--r--typing-break/drwright.c13
-rw-r--r--vfs-methods/fontilus/font-view.c16
-rw-r--r--vfs-methods/themus/themus-theme-applier.c5
46 files changed, 238 insertions, 109 deletions
diff --git a/ChangeLog b/ChangeLog
index 98c534669..cde79e1eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,49 @@
+2005-05-22 Sebastien Bacher <seb128@debian.org>
+
+ * ChangeLog capplets/about-me/e-image-chooser.c
+ capplets/accessibility/at-properties/at-startup-session.h
+ capplets/accessibility/keyboard/accessibility-keyboard.c
+ capplets/background/gnome-wp-info.c
+ capplets/common/gconf-property-editor.c
+ capplets/common/gnome-theme-apply.c
+ capplets/default-applications/gnome-default-applications-properties.c
+ capplets/keybindings/gnome-keybinding-properties.c
+ capplets/keyboard/gnome-keyboard-properties.c
+ capplets/mouse/gnome-mouse-properties.c
+ capplets/network/gnome-network-preferences.c
+ capplets/sound/sound-properties-capplet.c
+ capplets/theme-switcher/gnome-theme-details.c
+ capplets/theme-switcher/gnome-theme-manager.c
+ capplets/ui-properties/gnome-ui-properties.c
+ capplets/windows/gnome-window-properties.c
+ gnome-settings-daemon/factory.c
+ gnome-settings-daemon/gnome-settings-accessibility-keyboard.c
+ gnome-settings-daemon/gnome-settings-background.c
+ gnome-settings-daemon/gnome-settings-daemon.c
+ gnome-settings-daemon/gnome-settings-daemon.h
+ gnome-settings-daemon/gnome-settings-font.c
+ gnome-settings-daemon/gnome-settings-keybindings.c
+ gnome-settings-daemon/gnome-settings-keybindings.h
+ gnome-settings-daemon/gnome-settings-keyboard-xkb.c
+ gnome-settings-daemon/gnome-settings-keyboard.c
+ gnome-settings-daemon/gnome-settings-locate-pointer.h
+ gnome-settings-daemon/gnome-settings-mouse.c
+ gnome-settings-daemon/gnome-settings-multimedia-keys.c
+ gnome-settings-daemon/gnome-settings-screensaver.c
+ gnome-settings-daemon/gnome-settings-sound.c
+ gnome-settings-daemon/gnome-settings-xmodmap.c
+ gnome-settings-daemon/gnome-settings-xrdb.c
+ gnome-settings-daemon/gnome-settings-xsettings.c
+ libbackground/applier.c libbackground/applier.h
+ libbackground/preferences.c libsounds/sound-properties.c
+ libsounds/sound-view.h libwindow-settings/gnome-wm-manager.c
+ libwindow-settings/metacity-window-manager.c
+ typing-break/drw-break-window.c typing-break/drw-utils.h
+ typing-break/drwright.c vfs-methods/fontilus/font-view.c
+ vfs-methods/themus/themus-theme-applier.c:
+ Cleanup of gconf and a few other things,
+ patch from Kjartan Maraas <kmaraas@gnome.org> (Closes: #301945).
+
2005-05-12 Christian Persch <chpe@cvs.gnome.org>
* capplets/ui-properties/gnome-ui-properties.glade:
diff --git a/NEWS b/NEWS
index 5f7a961f8..a6301c400 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ gnome-control-center 2.11.1
- new shell layout code (Carlos Garnacho Parro)
- port of the font capplet to gtk_font_button and some cleanup (Paolo Borelli)
- make proxy settings HIG compliant (Jorn Baayen)
+- lot of cleanups (Kjartan Maraas)
------------------------------------------------------------------------------
gnome-control-center 2.10.0
diff --git a/capplets/about-me/e-image-chooser.c b/capplets/about-me/e-image-chooser.c
index 7d6a72d35..436b95fb1 100644
--- a/capplets/about-me/e-image-chooser.c
+++ b/capplets/about-me/e-image-chooser.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
+#include <glib/gi18n.h>
#include <gtk/gtkalignment.h>
#include <gtk/gtkframe.h>
#include <gtk/gtkimage.h>
@@ -30,7 +31,6 @@
#include <gtk/gtkdnd.h>
#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnome/gnome-i18n.h>
#include "e-image-chooser.h"
#include "e-util-marshal.h"
diff --git a/capplets/accessibility/at-properties/at-startup-session.h b/capplets/accessibility/at-properties/at-startup-session.h
index d94ed2fbf..603957ccb 100644
--- a/capplets/accessibility/at-properties/at-startup-session.h
+++ b/capplets/accessibility/at-properties/at-startup-session.h
@@ -1,5 +1,4 @@
-#include <config.h>
-#include <gtk/gtk.h>
+#include <glib.h>
typedef union {
guint flags;
diff --git a/capplets/accessibility/keyboard/accessibility-keyboard.c b/capplets/accessibility/keyboard/accessibility-keyboard.c
index 003e6ca15..fca91b479 100644
--- a/capplets/accessibility/keyboard/accessibility-keyboard.c
+++ b/capplets/accessibility/keyboard/accessibility-keyboard.c
@@ -386,6 +386,8 @@ load_CDE_file (GtkFileChooser *fchooser)
found |= xrm_get_bool (client, &db, CONFIG_ROOT "/enable",
"*EnableAccessXToggle.set", "AccessX*ToggleButtonGadget.XmCSet");
+ g_object_unref (client);
+
if (!found) {
/* it would be nice to have a better message bu that would
* break string freeze
@@ -460,6 +462,7 @@ setup_accessX_dialog (GConfChangeSet *changeset)
client = gconf_client_get_default ();
gconf_client_add_dir (client, CONFIG_ROOT, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ g_object_unref (client);
setup_dialog (dialog, changeset);
diff --git a/capplets/background/gnome-wp-info.c b/capplets/background/gnome-wp-info.c
index 4da9643a7..ba6afb618 100644
--- a/capplets/background/gnome-wp-info.c
+++ b/capplets/background/gnome-wp-info.c
@@ -28,11 +28,15 @@ GnomeWPInfo * gnome_wp_info_new (const gchar * uri,
GnomeVFSFileInfo * info;
GnomeVFSResult result;
+ gchar *escaped_uri = gnome_vfs_escape_path_string (uri);
+
info = gnome_vfs_file_info_new ();
- result = gnome_vfs_get_file_info (gnome_vfs_escape_path_string (uri), info,
+ result = gnome_vfs_get_file_info (escaped_uri, info,
GNOME_VFS_FILE_INFO_DEFAULT |
GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
+ g_free (escaped_uri);
+
if (info == NULL || info->mime_type == NULL || result != GNOME_VFS_OK) {
if (!strcmp (uri, "(none)")) {
new = g_new0 (GnomeWPInfo, 1);
diff --git a/capplets/common/gconf-property-editor.c b/capplets/common/gconf-property-editor.c
index a069320a3..034a09cf8 100644
--- a/capplets/common/gconf-property-editor.c
+++ b/capplets/common/gconf-property-editor.c
@@ -261,6 +261,7 @@ gconf_property_editor_set_prop (GObject *object,
gconf_client_notify_add (client, peditor->p->key,
peditor->p->callback,
peditor, NULL, NULL);
+ g_object_unref (client);
break;
case PROP_CHANGESET:
@@ -340,6 +341,7 @@ gconf_property_editor_finalize (GObject *object)
client = gconf_client_get_default ();
gconf_client_notify_remove (client,
gconf_property_editor->p->handler_id);
+ g_object_unref (client);
}
g_free (gconf_property_editor->p);
@@ -408,10 +410,14 @@ peditor_set_gconf_value (GConfPropertyEditor *peditor,
const gchar *key,
GConfValue *value)
{
+ GConfClient *client = gconf_client_get_default();
+
if (peditor->p->changeset != NULL)
gconf_change_set_set (peditor->p->changeset, peditor->p->key, value);
else
- gconf_client_set (gconf_client_get_default (), peditor->p->key, value, NULL);
+ gconf_client_set (client, peditor->p->key, value, NULL);
+
+ g_object_unref (client);
}
static void
@@ -1107,15 +1113,20 @@ peditor_numeric_range_widget_changed (GConfPropertyEditor *peditor,
GtkAdjustment *adjustment)
{
GConfValue *value, *value_wid, *default_value;
+ GConfClient *client;
if (!peditor->p->inited) return;
/* We try to get the default type from the schemas. if not, we default
* to a float.
*/
- default_value = gconf_client_get_default_from_schema (gconf_client_get_default (),
+ client = gconf_client_get_default();
+
+ default_value = gconf_client_get_default_from_schema (client,
peditor->p->key,
NULL);
+ g_object_unref (client);
+
if (default_value)
value_wid = gconf_value_new (default_value->type);
else {
@@ -1225,6 +1236,7 @@ gconf_peditor_widget_set_guard (GConfPropertyEditor *peditor,
client = gconf_client_get_default ();
value = gconf_client_get (client, peditor->p->key, NULL);
+ g_object_unref (client);
if (value) {
gtk_widget_set_sensitive (widget, guard_get_bool (peditor, value));
@@ -1615,6 +1627,7 @@ peditor_image_clicked_cb (GConfPropertyEditor *peditor, GtkButton *button)
{
GConfClient *client = gconf_client_get_default ();
value = gconf_client_get (client, peditor->p->key, NULL);
+ g_object_unref (client);
}
value_wid = peditor->p->conv_to_widget_cb (peditor, value);
diff --git a/capplets/common/gnome-theme-apply.c b/capplets/common/gnome-theme-apply.c
index c6831f677..e11b25fa8 100644
--- a/capplets/common/gnome-theme-apply.c
+++ b/capplets/common/gnome-theme-apply.c
@@ -61,4 +61,5 @@ gnome_meta_theme_set (GnomeThemeMetaInfo *meta_theme_info)
gconf_client_set_string (client, ICON_THEME_KEY, meta_theme_info->icon_theme_name, NULL);
}
g_free (old_key);
+ g_object_unref (client);
}
diff --git a/capplets/default-applications/gnome-default-applications-properties.c b/capplets/default-applications/gnome-default-applications-properties.c
index fd2a05a61..0374e28b0 100644
--- a/capplets/default-applications/gnome-default-applications-properties.c
+++ b/capplets/default-applications/gnome-default-applications-properties.c
@@ -788,6 +788,7 @@ main (int argc, char **argv)
dialog = create_dialog (client);
gtk_main ();
}
+ g_object_unref (client);
return 0;
}
diff --git a/capplets/keybindings/gnome-keybinding-properties.c b/capplets/keybindings/gnome-keybinding-properties.c
index 3e4d17d55..72d81f5e5 100644
--- a/capplets/keybindings/gnome-keybinding-properties.c
+++ b/capplets/keybindings/gnome-keybinding-properties.c
@@ -391,6 +391,8 @@ clear_old_model (GladeXML *dialog,
g_object_unref (model);
}
+ g_object_unref (client);
+
model = (GtkTreeModel *) gtk_tree_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER);
sort_model = gtk_tree_model_sort_new_with_model (model);
@@ -425,13 +427,17 @@ static gboolean
should_show_key (const KeyListEntry *entry)
{
gint workspaces;
-
+ GConfClient *client;
+
switch (entry->visibility) {
case ALWAYS_VISIBLE:
return TRUE;
case N_WORKSPACES_GT:
- workspaces = gconf_client_get_int (gconf_client_get_default (),
+ client = gconf_client_get_default();
+ workspaces = gconf_client_get_int (client,
"/apps/metacity/general/num_workspaces", NULL);
+ g_object_unref (client);
+
if (workspaces > entry->data)
return TRUE;
else
@@ -544,6 +550,8 @@ append_keys_to_tree (GladeXML *dialog,
gconf_schema_free (schema);
}
+ g_object_unref (client);
+
if (i == 0)
gtk_widget_hide (WID ("shortcuts_vbox"));
else
@@ -884,6 +892,7 @@ setup_dialog (GladeXML *dialog)
"/apps/metacity/general/num_workspaces",
(GConfClientNotifyFunc) &key_entry_controlling_key_changed,
dialog, NULL, NULL);
+ g_object_unref (client);
/* set up the dialog */
reload_key_entries (wm_common_get_current_window_manager(), dialog);
diff --git a/capplets/keyboard/gnome-keyboard-properties.c b/capplets/keyboard/gnome-keyboard-properties.c
index 3ee658df0..ef9a108bd 100644
--- a/capplets/keyboard/gnome-keyboard-properties.c
+++ b/capplets/keyboard/gnome-keyboard-properties.c
@@ -242,6 +242,7 @@ main (int argc, char **argv)
client = gconf_client_get_default ();
gconf_client_add_dir (client, "/desktop/gnome/peripherals/keyboard", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ g_object_unref (client);
if (get_legacy) {
get_legacy_settings ();
diff --git a/capplets/mouse/gnome-mouse-properties.c b/capplets/mouse/gnome-mouse-properties.c
index 24d102cac..581326a9d 100644
--- a/capplets/mouse/gnome-mouse-properties.c
+++ b/capplets/mouse/gnome-mouse-properties.c
@@ -99,8 +99,6 @@ enum
#define CURSOR_FONT_KEY "/desktop/gnome/peripherals/mouse/cursor_font"
#define CURSOR_SIZE_KEY "/desktop/gnome/peripherals/mouse/cursor_size"
-GConfClient *client;
-
#ifdef HAVE_XCURSOR
static gboolean server_supports_xcursor = TRUE;
#else
@@ -338,15 +336,19 @@ event_box_button_press_event (GtkWidget *widget,
static guint test_maybe_timeout_id = 0;
static guint32 double_click_timestamp = 0;
GtkWidget *image;
+ GConfClient *client;
if (event->type != GDK_BUTTON_PRESS)
return FALSE;
image = g_object_get_data (G_OBJECT (widget), "image");
- if (!(changeset && gconf_change_set_check_value (changeset, DOUBLE_CLICK_KEY, &value)))
- double_click_time = gconf_client_get_int (gconf_client_get_default (), DOUBLE_CLICK_KEY, NULL);
- else
+ if (!(changeset && gconf_change_set_check_value (changeset, DOUBLE_CLICK_KEY, &value))) {
+ client = gconf_client_get_default();
+ double_click_time = gconf_client_get_int (client, DOUBLE_CLICK_KEY, NULL);
+ g_object_unref (client);
+
+ } else
double_click_time = gconf_value_get_int (value);
if (test_maybe_timeout_id != 0)
@@ -511,6 +513,7 @@ cursor_changed (GtkTreeSelection *selection,
GtkTreeModel *model = NULL;
GtkTreeIter iter;
gchar *cursor_font = NULL;
+ GConfClient *client = gconf_client_get_default ();
if (! gtk_tree_selection_get_selected (selection, &model, &iter))
return;
@@ -519,12 +522,13 @@ cursor_changed (GtkTreeSelection *selection,
COLUMN_FONT_PATH, &cursor_font,
-1);
if (cursor_font != NULL) {
- gconf_client_set_string (gconf_client_get_default (),
+ gconf_client_set_string (client,
CURSOR_FONT_KEY, cursor_font, NULL);
g_free (cursor_font);
} else
- gconf_client_unset (gconf_client_get_default (),
+ gconf_client_unset (client,
CURSOR_FONT_KEY, NULL);
+ g_object_unref (client);
}
/* Set up the property editors in the dialog. */
@@ -548,6 +552,8 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
gboolean found_default;
gchar *message;
+ GConfClient *client = gconf_client_get_default ();
+
program = gnome_program_get ();
found_default = FALSE;
@@ -558,7 +564,7 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
g_signal_connect (peditor, "value-changed", (GCallback) left_handed_toggle_cb, WID ("orientation_image"));
/* Make sure the image gets initialized correctly */
- value = gconf_client_get (gconf_client_get_default (), "/desktop/gnome/peripherals/mouse/left_handed", NULL);
+ value = gconf_client_get (client, "/desktop/gnome/peripherals/mouse/left_handed", NULL);
left_handed_toggle_cb (GCONF_PROPERTY_EDITOR (peditor), NULL, value, WID ("orientation_image"));
gconf_value_free (value);
@@ -724,13 +730,14 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
NULL);
/* listen to cursors changing */
- gconf_client_notify_add (gconf_client_get_default (),
+ gconf_client_notify_add (client,
CURSOR_FONT_KEY,
cursor_font_changed,
tree_view, NULL, NULL);
/* and set it up initially... */
- cursor_font_changed (gconf_client_get_default (), 0, NULL, tree_view);
+ cursor_font_changed (client, 0, NULL, tree_view);
+ g_object_unref (client);
}
/* Construct the dialog */
@@ -829,6 +836,7 @@ main (int argc, char **argv)
client = gconf_client_get_default ();
gconf_client_add_dir (client, "/desktop/gnome/peripherals/mouse", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ g_object_unref (client);
if (get_legacy) {
get_legacy_settings ();
diff --git a/capplets/network/gnome-network-preferences.c b/capplets/network/gnome-network-preferences.c
index 76e3e1783..5a6fceb1c 100644
--- a/capplets/network/gnome-network-preferences.c
+++ b/capplets/network/gnome-network-preferences.c
@@ -126,7 +126,7 @@ cb_add_url (GtkButton *button, gpointer data)
client = gconf_client_get_default ();
gconf_client_set_list (client, IGNORE_HOSTS_KEY, GCONF_VALUE_STRING, ignore_hosts, NULL);
-
+ g_object_unref (client);
}
static void
@@ -161,6 +161,7 @@ cb_remove_url (GtkButton *button, gpointer data)
client = gconf_client_get_default ();
gconf_client_set_list(client, IGNORE_HOSTS_KEY, GCONF_VALUE_STRING, ignore_hosts, NULL);
+ g_object_unref (client);
}
}
@@ -395,6 +396,8 @@ setup_dialog (GladeXML *dialog)
gtk_label_set_use_markup (GTK_LABEL (WID ("label_ignore_host")), TRUE);
ignore_hosts = gconf_client_get_list(client, IGNORE_HOSTS_KEY, GCONF_VALUE_STRING, NULL);
+ g_object_unref (client);
+
model = create_listmodel();
populate_listmodel(GTK_LIST_STORE(model), ignore_hosts);
config_treeview(GTK_TREE_VIEW(WID("treeview_ignore_host")), model);
diff --git a/capplets/sound/sound-properties-capplet.c b/capplets/sound/sound-properties-capplet.c
index d20c211b1..f8c6ee773 100644
--- a/capplets/sound/sound-properties-capplet.c
+++ b/capplets/sound/sound-properties-capplet.c
@@ -285,6 +285,7 @@ main (int argc, char **argv)
gconf_change_set_unref (changeset);
}
+ g_object_unref (client);
g_object_unref (dialog);
return 0;
}
diff --git a/capplets/theme-switcher/gnome-theme-details.c b/capplets/theme-switcher/gnome-theme-details.c
index 1a7ebe558..6dd4732a3 100644
--- a/capplets/theme-switcher/gnome-theme-details.c
+++ b/capplets/theme-switcher/gnome-theme-details.c
@@ -269,7 +269,6 @@ update_gconf_key_from_selection (GtkTreeSelection *selection,
void
gnome_theme_details_init (void)
{
- GConfClient *client;
GtkWidget *parent, *widget;
GnomeWindowManager *window_manager;
GladeXML *dialog;
@@ -279,7 +278,6 @@ gnome_theme_details_init (void)
theme_details_initted = TRUE;
dialog = gnome_theme_manager_get_theme_dialog ();
- client = gconf_client_get_default ();
window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ()));
parent = WID ("theme_details_dialog");
@@ -565,5 +563,6 @@ gnome_theme_details_update_from_gconf (void)
tree_view = WID ("icon_theme_treeview");
theme = gconf_client_get_string (client, ICON_THEME_KEY, NULL);
update_list_something (tree_view, theme);
+ g_object_unref (client);
g_free (theme);
}
diff --git a/capplets/theme-switcher/gnome-theme-manager.c b/capplets/theme-switcher/gnome-theme-manager.c
index 1be50b8ed..5a747cfa1 100644
--- a/capplets/theme-switcher/gnome-theme-manager.c
+++ b/capplets/theme-switcher/gnome-theme-manager.c
@@ -317,6 +317,8 @@ load_meta_themes (GtkTreeView *tree_view,
current_gtk_theme = gconf_client_get_string (client, GTK_THEME_KEY, NULL);
current_icon_theme = gconf_client_get_string (client, ICON_THEME_KEY, NULL);
+ g_object_unref (client);
+
window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ()));
wm_settings.flags = GNOME_WM_SETTING_THEME;
@@ -577,6 +579,8 @@ meta_theme_selection_changed (GtkTreeSelection *selection,
/* Get the settings */
current_gtk_theme = gconf_client_get_string (client, GTK_THEME_KEY, NULL);
current_icon_theme = gconf_client_get_string (client, ICON_THEME_KEY, NULL);
+ g_object_unref (client);
+
window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ()));
wm_settings.flags = GNOME_WM_SETTING_THEME;
if (window_manager) {
@@ -785,6 +789,8 @@ update_settings_from_gconf_idle (gpointer data)
/* Get the settings */
current_gtk_theme = gconf_client_get_string (client, GTK_THEME_KEY, NULL);
current_icon_theme = gconf_client_get_string (client, ICON_THEME_KEY, NULL);
+ g_object_unref (client);
+
window_manager = gnome_wm_manager_get_current (gdk_display_get_default_screen (gdk_display_get_default ()));
wm_settings.flags = GNOME_WM_SETTING_THEME;
if (window_manager) {
@@ -978,7 +984,7 @@ update_font_button_state (GladeXML *dialog)
g_free (str);
}
-
+ g_object_unref (client);
}
static void
@@ -1125,6 +1131,7 @@ apply_font_clicked (GtkWidget *button,
gconf_client_set_string (client, FONT_KEY, meta_theme_info->application_font, NULL);
}
+ g_object_unref (client);
}
static void
@@ -1197,6 +1204,8 @@ setup_dialog (GladeXML *dialog)
FONT_KEY,
(GConfClientNotifyFunc) &font_key_changed,
dialog, NULL, NULL);
+ g_object_unref (client);
+
if (window_manager)
g_signal_connect (G_OBJECT (window_manager),
"settings_changed",
@@ -1415,6 +1424,7 @@ get_default_string_from_key (const char *key)
client = gconf_client_get_default ();
value = gconf_client_get_default_from_schema (client, key, &error);
+ g_object_unref (client);
if (error)
{
diff --git a/capplets/ui-properties/gnome-ui-properties.c b/capplets/ui-properties/gnome-ui-properties.c
index 062862455..14091475a 100644
--- a/capplets/ui-properties/gnome-ui-properties.c
+++ b/capplets/ui-properties/gnome-ui-properties.c
@@ -223,6 +223,7 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
GtkWidget *widget;
GObject *peditor;
char *toolbar_style;
+ GConfClient *client = gconf_client_get_default ();
peditor = gconf_peditor_new_boolean
(changeset, "/desktop/gnome/interface/toolbar_detachable", WID ("detachable_toolbars_toggle"), NULL);
@@ -240,7 +241,7 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
G_CALLBACK (menus_have_icons_cb), dialog);
set_have_icons (dialog,
- gconf_client_get_bool (gconf_client_get_default (),
+ gconf_client_get_bool (client,
"/desktop/gnome/interface/menus_have_icons",
NULL));
@@ -264,14 +265,15 @@ setup_dialog (GladeXML *dialog, GConfChangeSet *changeset)
G_CALLBACK (dialog_button_clicked_cb), changeset);
show_handlebar (dialog,
- gconf_client_get_bool (gconf_client_get_default (),
+ gconf_client_get_bool (client,
"/desktop/gnome/interface/toolbar_detachable",
NULL));
- toolbar_style = gconf_client_get_string (gconf_client_get_default (),
+ toolbar_style = gconf_client_get_string (client,
"/desktop/gnome/interface/toolbar_style",
NULL);
-
+ g_object_unref (client);
+
set_toolbar_style (dialog, toolbar_style);
g_free (toolbar_style);
@@ -299,7 +301,7 @@ main (int argc, char **argv)
client = gconf_client_get_default ();
gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
+ g_object_unref (client);
dialog = create_dialog ();
setup_dialog (dialog, changeset);
gtk_main ();
diff --git a/capplets/windows/gnome-window-properties.c b/capplets/windows/gnome-window-properties.c
index d8d49b429..9f3725f55 100644
--- a/capplets/windows/gnome-window-properties.c
+++ b/capplets/windows/gnome-window-properties.c
@@ -27,7 +27,6 @@
#include <config.h>
#endif
-#include <gconf/gconf-client.h>
#include <glade/glade.h>
#include <gnome-wm-manager.h>
@@ -42,7 +41,6 @@ typedef struct
GtkWidget *radio;
} MouseClickModifier;
-static GConfClient *gconf_client;
static GladeXML *dialog;
static GnomeWindowManager *current_wm; /* may be NULL */
static GtkWidget *dialog_win;
@@ -430,8 +428,6 @@ main (int argc, char **argv)
LIBGNOMEUI_MODULE, argc, argv,
NULL);
- gconf_client = gconf_client_get_default ();
-
gnome_wm_manager_init ();
screen = gdk_display_get_default_screen (gdk_display_get_default ());
diff --git a/gnome-settings-daemon/factory.c b/gnome-settings-daemon/factory.c
index ea73a4cb6..20948e626 100644
--- a/gnome-settings-daemon/factory.c
+++ b/gnome-settings-daemon/factory.c
@@ -6,6 +6,8 @@
#include <bonobo/bonobo-object.h>
#include <bonobo/bonobo-generic-factory.h>
+#include <gconf/gconf.h>
+
#include <libgnome/gnome-init.h>
#include <libgnomeui/gnome-ui-init.h>
#include <libgnomeui/gnome-client.h>
diff --git a/gnome-settings-daemon/gnome-settings-accessibility-keyboard.c b/gnome-settings-daemon/gnome-settings-accessibility-keyboard.c
index 61a385cad..b89ea528d 100644
--- a/gnome-settings-daemon/gnome-settings-accessibility-keyboard.c
+++ b/gnome-settings-daemon/gnome-settings-accessibility-keyboard.c
@@ -23,9 +23,11 @@
#include "config.h"
-#include <libgnome/gnome-i18n.h>
+#include <glib/gi18n.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
#include <gconf/gconf-client.h>
#include <libgnome/gnome-help.h>
@@ -285,12 +287,13 @@ set_server_from_gconf (GConfEntry *ignored)
XSync (GDK_DISPLAY (), FALSE);
gdk_error_trap_pop ();
+
+ g_object_unref (client);
}
static gboolean
ax_response_callback (gint response_id, guint revert_controls_mask, gboolean enabled)
{
- GConfClient *client = gconf_client_get_default ();
GError *err = NULL;
gboolean success;
@@ -298,6 +301,9 @@ ax_response_callback (gint response_id, guint revert_controls_mask, gboolean ena
{
case GTK_RESPONSE_REJECT:
case GTK_RESPONSE_CANCEL:
+ {
+ GConfClient *client = gconf_client_get_default ();
+
/* we're reverting, so we invert sense of 'enabled' flag */
d ("cancelling AccessX request");
if (revert_controls_mask == XkbStickyKeysMask)
@@ -315,6 +321,7 @@ ax_response_callback (gint response_id, guint revert_controls_mask, gboolean ena
gconf_client_suggest_sync (client, NULL);
set_server_from_gconf (NULL);
break;
+ }
case GTK_RESPONSE_HELP:
gnome_help_display_desktop (NULL,
"user-guide",
@@ -537,6 +544,7 @@ set_gconf_from_server (GConfEntry *ignored)
gconf_client_suggest_sync (client, NULL);
}
gconf_change_set_unref (cs);
+ g_object_unref (client);
}
static GdkFilterReturn
diff --git a/gnome-settings-daemon/gnome-settings-background.c b/gnome-settings-daemon/gnome-settings-background.c
index 106bd82cd..f695a4ed4 100644
--- a/gnome-settings-daemon/gnome-settings-background.c
+++ b/gnome-settings-daemon/gnome-settings-background.c
@@ -37,11 +37,7 @@
#include "preferences.h"
#include "applier.h"
-#ifdef HAVE_GTK_MULTIHEAD
static BGApplier **bg_appliers;
-#else
-static BGApplier *bg_applier;
-#endif
static BGPreferences *prefs;
static guint applier_idle_id = 0;
@@ -49,13 +45,9 @@ static guint applier_idle_id = 0;
static gboolean
applier_idle (gpointer data)
{
-#ifdef HAVE_GTK_MULTIHEAD
int i;
for (i = 0; bg_appliers [i]; i++)
bg_applier_apply_prefs (bg_appliers [i], prefs);
-#else
- bg_applier_apply_prefs (bg_applier, prefs);
-#endif
applier_idle_id = 0;
return FALSE;
}
@@ -75,7 +67,6 @@ background_callback (GConfEntry *entry)
void
gnome_settings_background_init (GConfClient *client)
{
-#ifdef HAVE_GTK_MULTIHEAD
GdkDisplay *display;
int n_screens;
int i;
@@ -93,9 +84,6 @@ gnome_settings_background_init (GConfClient *client)
bg_appliers [i] = BG_APPLIER (bg_applier_new_for_screen (BG_APPLIER_ROOT, screen));
}
bg_appliers [i] = NULL;
-#else
- bg_applier = BG_APPLIER (bg_applier_new (BG_APPLIER_ROOT));
-#endif
prefs = BG_PREFERENCES (bg_preferences_new ());
bg_preferences_load (prefs);
@@ -106,9 +94,7 @@ gnome_settings_background_init (GConfClient *client)
void
gnome_settings_background_load (GConfClient *client)
{
-#ifdef HAVE_GTK_MULTIHEAD
int i;
-#endif
/* If this is set, nautilus will draw the background and is
* almost definitely in our session. however, it may not be
@@ -121,10 +107,6 @@ gnome_settings_background_load (GConfClient *client)
if (gconf_client_get_bool (client, "/apps/nautilus/preferences/show_desktop", NULL))
return;
-#ifdef HAVE_GTK_MULTIHEAD
for (i = 0; bg_appliers [i]; i++)
bg_applier_apply_prefs (bg_appliers [i], prefs);
-#else
- bg_applier_apply_prefs (bg_applier, prefs);
-#endif
}
diff --git a/gnome-settings-daemon/gnome-settings-daemon.c b/gnome-settings-daemon/gnome-settings-daemon.c
index 30bb3e44d..d70430f40 100644
--- a/gnome-settings-daemon/gnome-settings-daemon.c
+++ b/gnome-settings-daemon/gnome-settings-daemon.c
@@ -20,17 +20,18 @@
*
* Authors: Owen Taylor, Havoc Pennington
*/
+#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <gtk/gtk.h>
#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
#include <gconf/gconf.h>
#include <libgnome/gnome-init.h>
#include <libgnomeui/gnome-ui-init.h>
-#include <config.h>
#include <errno.h>
#include <sys/types.h>
@@ -276,7 +277,7 @@ gnome_settings_daemon_new (void)
gnome_settings_xsettings_init (client);
gnome_settings_mouse_init (client);
/* Essential - xkb initialization should happen before */
- gnome_settings_keyboard_xkb_set_post_activation_callback (gnome_settings_load_modmap_files, NULL);
+ 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);
@@ -345,6 +346,8 @@ gnome_settings_daemon_new (void)
gnome_settings_xrdb_load (client);
gnome_settings_typing_break_load (client);
+ g_object_unref (client);
+
return G_OBJECT (daemon);
}
diff --git a/gnome-settings-daemon/gnome-settings-daemon.h b/gnome-settings-daemon/gnome-settings-daemon.h
index 8908977ba..9621640d0 100644
--- a/gnome-settings-daemon/gnome-settings-daemon.h
+++ b/gnome-settings-daemon/gnome-settings-daemon.h
@@ -24,9 +24,9 @@
#ifndef __GNOME_SETTINGS_DAEMON_H
#define __GNOME_SETTINGS_DAEMON_H
+#include <gtk/gtk.h>
#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
-#include <gtk/gtk.h>
#include <bonobo/bonobo-object.h>
diff --git a/gnome-settings-daemon/gnome-settings-font.c b/gnome-settings-daemon/gnome-settings-font.c
index bf960441c..ee4ee7ff7 100644
--- a/gnome-settings-daemon/gnome-settings-font.c
+++ b/gnome-settings-daemon/gnome-settings-font.c
@@ -1,8 +1,7 @@
#include <config.h>
-#include <gdk/gdkx.h>
-#include <gconf/gconf.h>
-#include <libgnome/gnome-i18n.h>
+
#include "gnome-settings-daemon.h"
+
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -10,6 +9,11 @@
#include <dirent.h>
#include <string.h>
+#include <glib/gi18n.h>
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
+#include <gconf/gconf.h>
static void
load_xcursor_theme (GConfClient *client)
diff --git a/gnome-settings-daemon/gnome-settings-keybindings.c b/gnome-settings-daemon/gnome-settings-keybindings.c
index 7f27c0dec..a6c9ce8e4 100644
--- a/gnome-settings-daemon/gnome-settings-keybindings.c
+++ b/gnome-settings-daemon/gnome-settings-keybindings.c
@@ -2,10 +2,10 @@
#include <string.h>
#include <X11/keysym.h>
+#include <glib/gi18n.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
-#include <libgnome/gnome-i18n.h>
#include "gnome-settings-daemon.h"
#include "gnome-settings-keybindings.h"
#include "eggaccelerators.h"
@@ -178,6 +178,7 @@ bindings_get_entry (char *subdir)
char *gconf_key;
char *action = NULL;
char *key = NULL;
+ GConfClient *client = gconf_client_get_default();
g_return_val_if_fail (subdir != NULL, FALSE);
@@ -188,7 +189,8 @@ bindings_get_entry (char *subdir)
return FALSE;
/* Get entries for this binding */
- list = gconf_client_all_entries (gconf_client_get_default (), subdir, NULL);
+ list = gconf_client_all_entries (client, subdir, NULL);
+ g_object_unref (client);
for (li = list; li != NULL; li = li->next)
{
diff --git a/gnome-settings-daemon/gnome-settings-keybindings.h b/gnome-settings-daemon/gnome-settings-keybindings.h
index 098fb3554..eadd4ae91 100644
--- a/gnome-settings-daemon/gnome-settings-keybindings.h
+++ b/gnome-settings-daemon/gnome-settings-keybindings.h
@@ -25,6 +25,8 @@
#define __GNOME_SETTINGS_KEYBINDINGS_H__
#include <gconf/gconf.h>
+#include <gconf/gconf-client.h>
+
void gnome_settings_keybindings_init (GConfClient *client);
void gnome_settings_keybindings_load (GConfClient *client);
diff --git a/gnome-settings-daemon/gnome-settings-keyboard-xkb.c b/gnome-settings-daemon/gnome-settings-keyboard-xkb.c
index 8664b287a..703390797 100644
--- a/gnome-settings-daemon/gnome-settings-keyboard-xkb.c
+++ b/gnome-settings-daemon/gnome-settings-keyboard-xkb.c
@@ -26,7 +26,7 @@
# include "config.h"
#endif
-//#include <glib/gstrfuncs.h>
+#include <glib/gi18n.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gconf/gconf-client.h>
@@ -35,8 +35,6 @@
#include <string.h>
#include <time.h>
-#include <libgnome/gnome-i18n.h>
-
#include <libxklavier/xklavier.h>
#include <libxklavier/xklavier_config.h>
#include <libgswitchit/gswitchit_config.h>
diff --git a/gnome-settings-daemon/gnome-settings-keyboard.c b/gnome-settings-daemon/gnome-settings-keyboard.c
index 6e10d6ddd..bdad73b79 100644
--- a/gnome-settings-daemon/gnome-settings-keyboard.c
+++ b/gnome-settings-daemon/gnome-settings-keyboard.c
@@ -106,6 +106,7 @@ apply_settings (void)
volume_string = gconf_client_get_string (client, "/desktop/gnome/peripherals/keyboard/bell_mode", NULL);
bell_volume = (volume_string && !strcmp (volume_string, "on")) ? 50 : 0;
g_free (volume_string);
+ g_object_unref (client);
gdk_error_trap_push ();
if (repeat) {
diff --git a/gnome-settings-daemon/gnome-settings-locate-pointer.h b/gnome-settings-daemon/gnome-settings-locate-pointer.h
index e07f14f61..e5924ac79 100644
--- a/gnome-settings-daemon/gnome-settings-locate-pointer.h
+++ b/gnome-settings-daemon/gnome-settings-locate-pointer.h
@@ -17,6 +17,8 @@
#ifndef LOCATE_POINTER_H
#define LOCATE_POINTER_H
+#include <gdk/gdkscreen.h>
+
void gnome_settings_locate_pointer (GdkScreen *screen);
#endif
diff --git a/gnome-settings-daemon/gnome-settings-mouse.c b/gnome-settings-daemon/gnome-settings-mouse.c
index 04d648b4d..825674571 100644
--- a/gnome-settings-daemon/gnome-settings-mouse.c
+++ b/gnome-settings-daemon/gnome-settings-mouse.c
@@ -1,10 +1,13 @@
+#include <string.h>
+#include <math.h>
+
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
-#include <gconf/gconf.h>
-#include <math.h>
#include <gdk/gdkkeysyms.h>
#include <X11/keysym.h>
-#include <string.h>
+
+#include <gconf/gconf.h>
+
#include "gnome-settings-locate-pointer.h"
#include "gnome-settings-daemon.h"
diff --git a/gnome-settings-daemon/gnome-settings-multimedia-keys.c b/gnome-settings-daemon/gnome-settings-multimedia-keys.c
index c2d596820..42f7abdf7 100644
--- a/gnome-settings-daemon/gnome-settings-multimedia-keys.c
+++ b/gnome-settings-daemon/gnome-settings-multimedia-keys.c
@@ -21,12 +21,15 @@
#include <config.h>
+#include <string.h>
#include <sys/file.h>
#include <X11/X.h>
/* Gnome headers */
+#include <glib/gi18n.h>
#include <gdk/gdkx.h>
-#include <gnome.h>
+#include <gtk/gtk.h>
+
#include <glade/glade.h>
#include <gconf/gconf-client.h>
diff --git a/gnome-settings-daemon/gnome-settings-screensaver.c b/gnome-settings-daemon/gnome-settings-screensaver.c
index 535420ab9..75f8cbd45 100644
--- a/gnome-settings-daemon/gnome-settings-screensaver.c
+++ b/gnome-settings-daemon/gnome-settings-screensaver.c
@@ -24,9 +24,10 @@
#include <config.h>
-#include <libgnome/gnome-i18n.h>
#include "gnome-settings-screensaver.h"
+#include <glib/gi18n.h>
+
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkbox.h>
#include <gtk/gtkmessagedialog.h>
@@ -61,6 +62,7 @@ key_toggled_cb (GtkWidget *toggle, gpointer data)
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))
? 0 : 1,
NULL);
+ g_object_unref (client);
}
void
diff --git a/gnome-settings-daemon/gnome-settings-sound.c b/gnome-settings-daemon/gnome-settings-sound.c
index 8cdad2c53..51410263e 100644
--- a/gnome-settings-daemon/gnome-settings-sound.c
+++ b/gnome-settings-daemon/gnome-settings-sound.c
@@ -29,13 +29,14 @@
#include <string.h>
#include <stdlib.h>
#include <time.h>
-#include <esd.h>
#include <sys/types.h>
+#include <glib/gi18n.h>
+
+#include <esd.h>
+
#include <gconf/gconf-client.h>
-#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-sound.h>
-#include <libgnome/gnome-util.h>
#include <libgnome/gnome-exec.h>
#include <libgnomeui/gnome-client.h>
#include "libsounds/sound-properties.h"
diff --git a/gnome-settings-daemon/gnome-settings-xmodmap.c b/gnome-settings-daemon/gnome-settings-xmodmap.c
index 3e345aafe..a9098d316 100644
--- a/gnome-settings-daemon/gnome-settings-xmodmap.c
+++ b/gnome-settings-daemon/gnome-settings-xmodmap.c
@@ -20,13 +20,17 @@
* 02111-1307, USA.
*/
+#include <config.h>
+#include "gnome-settings-xmodmap.h"
-#include <glade/glade.h>
-#include <gnome.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
-#include "gnome-settings-xmodmap.h"
-#include "config.h"
+
+#include <glade/glade.h>
static const char DISABLE_XMM_WARNING_KEY[] =
"/desktop/gnome/peripherals/keyboard/disable_xmm_and_xkb_warning";
@@ -48,7 +52,7 @@ check_button_callback (GtkWidget *chk_button,
gconf_client_set_bool (confClient, DISABLE_XMM_WARNING_KEY, FALSE,
NULL);
}
-
+ g_object_unref (confClient);
}
void
@@ -65,6 +69,7 @@ gnome_settings_load_modmap_files ()
tmp = tmp->next;
g_free (command);
}
+ g_object_unref (confClient);
}
static void
@@ -336,6 +341,7 @@ gnome_settings_modmap_dialog_call (void)
gtk_tree_view_column_set_sort_column_id (column, 0);
loaded_files = gconf_client_get_list (confClient, LOADED_FILES_KEY, GCONF_VALUE_STRING, NULL);
+ g_object_unref (confClient);
/* Add the data */
tmp = loaded_files;
diff --git a/gnome-settings-daemon/gnome-settings-xrdb.c b/gnome-settings-daemon/gnome-settings-xrdb.c
index 736ee1d21..51d22d8c7 100644
--- a/gnome-settings-daemon/gnome-settings-xrdb.c
+++ b/gnome-settings-daemon/gnome-settings-xrdb.c
@@ -25,7 +25,8 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
-#include <libgnome/gnome-i18n.h>
+#include <glib/gi18n.h>
+#include <gtk/gtkwindow.h>
#include <gconf/gconf-client.h>
#include "gnome-settings-daemon.h"
diff --git a/gnome-settings-daemon/gnome-settings-xsettings.c b/gnome-settings-daemon/gnome-settings-xsettings.c
index 707117fd5..bb58990fd 100644
--- a/gnome-settings-daemon/gnome-settings-xsettings.c
+++ b/gnome-settings-daemon/gnome-settings-xsettings.c
@@ -1,9 +1,10 @@
#include <config.h>
#include <string.h>
#include <stdio.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
#include <locale.h>
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gconf/gconf-client.h>
#include "gnome-settings-daemon.h"
#include "gnome-settings-xsettings.h"
@@ -253,6 +254,7 @@ xft_callback (GConfEntry *entry)
client = gconf_client_get_default ();
gnome_settings_update_xft (client);
+ g_object_unref (client);
for (i = 0; managers [i]; i++)
xsettings_manager_notify (managers [i]);
diff --git a/libbackground/applier.c b/libbackground/applier.c
index a45ef2c60..21e3de272 100644
--- a/libbackground/applier.c
+++ b/libbackground/applier.c
@@ -35,7 +35,6 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <unistd.h>
-#include <bonobo.h>
#include "applier.h"
diff --git a/libbackground/applier.h b/libbackground/applier.h
index d582f045e..e058123f6 100644
--- a/libbackground/applier.h
+++ b/libbackground/applier.h
@@ -28,7 +28,6 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <X11/Xlib.h>
-#include <pthread.h>
#include "preferences.h"
diff --git a/libbackground/preferences.c b/libbackground/preferences.c
index 782a269e4..791b79c5b 100644
--- a/libbackground/preferences.c
+++ b/libbackground/preferences.c
@@ -26,9 +26,10 @@
#endif
#include <stdlib.h>
+#include <string.h>
-#include <gnome.h>
-#include <bonobo.h>
+#include <glib.h>
+#include <gdk/gdk.h>
#include "preferences.h"
@@ -274,6 +275,8 @@ bg_preferences_load (BGPreferences *prefs)
} else {
prefs->wallpaper_enabled = TRUE;
}
+
+ g_object_unref (client);
}
/* Parse the event name given (the event being notification of a property having
@@ -439,10 +442,13 @@ bg_preferences_save (BGPreferences *prefs)
{
GConfChangeSet *cs;
gchar *tmp;
+ GConfClient *client;
g_return_if_fail (prefs != NULL);
g_return_if_fail (IS_BG_PREFERENCES (prefs));
+ client = gconf_client_get_default();
+
cs = gconf_change_set_new ();
gconf_change_set_set_bool (cs, BG_PREFERENCES_DRAW_BACKGROUND, prefs->enabled);
if (prefs->wallpaper_enabled)
@@ -468,8 +474,9 @@ bg_preferences_save (BGPreferences *prefs)
gconf_change_set_set_string (cs, BG_PREFERENCES_COLOR_SHADING_TYPE, bg_preferences_get_orientation_as_string (prefs->orientation));
- gconf_client_commit_change_set (gconf_client_get_default (), cs, TRUE, NULL);
+ gconf_client_commit_change_set (client, cs, TRUE, NULL);
gconf_change_set_unref (cs);
+ g_object_unref (client);
}
diff --git a/libwindow-settings/gnome-wm-manager.c b/libwindow-settings/gnome-wm-manager.c
index fc6eca9b6..4d9132f6a 100644
--- a/libwindow-settings/gnome-wm-manager.c
+++ b/libwindow-settings/gnome-wm-manager.c
@@ -29,10 +29,10 @@
#include "gnome-wm-manager.h"
#include <glib.h>
+#include <glib/gi18n.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-i18n.h>
#include <sys/types.h>
#include <dirent.h>
diff --git a/libwindow-settings/metacity-window-manager.c b/libwindow-settings/metacity-window-manager.c
index d63272294..bba39795a 100644
--- a/libwindow-settings/metacity-window-manager.c
+++ b/libwindow-settings/metacity-window-manager.c
@@ -27,8 +27,8 @@
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
+#include <glib/gi18n.h>
#include <gconf/gconf-client.h>
-#include <libgnome/gnome-i18n.h>
#include "metacity-window-manager.h"
diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c
index 267263164..0fac2efc4 100644
--- a/typing-break/drw-break-window.c
+++ b/typing-break/drw-break-window.c
@@ -23,10 +23,10 @@
#include <config.h>
#include <string.h>
#include <math.h>
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <gconf/gconf-client.h>
-#include <libgnome/gnome-i18n.h>
#include "drwright.h"
#include "drw-utils.h"
#include "drw-break-window.h"
@@ -151,18 +151,21 @@ drw_break_window_init (DrwBreakWindow *window)
GdkRectangle monitor;
gint right_padding;
gint bottom_padding;
-
+ GConfClient *client;
priv = g_new0 (DrwBreakWindowPriv, 1);
window->priv = priv;
- priv->break_time = 60 * gconf_client_get_int (gconf_client_get_default (),
+ client = gconf_client_get_default();
+
+ priv->break_time = 60 * gconf_client_get_int (client,
GCONF_PATH "/break_time",
NULL);
- allow_postpone = gconf_client_get_bool (gconf_client_get_default (),
+ allow_postpone = gconf_client_get_bool (client,
GCONF_PATH "/allow_postpone",
NULL);
+ g_object_unref (client);
GTK_WINDOW (window)->type = GTK_WINDOW_POPUP;
@@ -414,12 +417,14 @@ postpone_entry_activate_cb (GtkWidget *entry,
{
const gchar *str;
const gchar *phrase;
+ GConfClient *client = gconf_client_get_default();
str = gtk_entry_get_text (GTK_ENTRY (entry));
- phrase = gconf_client_get_string (gconf_client_get_default (),
+ phrase = gconf_client_get_string (client,
GCONF_PATH "/unlock_phrase",
NULL);
+ g_object_unref (client);
if (!strcmp (str, phrase)) {
g_signal_emit (window, signals[POSTPONE], 0, NULL);
diff --git a/typing-break/drw-utils.h b/typing-break/drw-utils.h
index 968f531fd..30bacad70 100644
--- a/typing-break/drw-utils.h
+++ b/typing-break/drw-utils.h
@@ -21,6 +21,8 @@
#ifndef __DRW_UTILS_H__
#define __DRW_UTILS_H__
+#include <gtk/gtkwidget.h>
+
void drw_setup_background (GtkWidget *window);
diff --git a/typing-break/drwright.c b/typing-break/drwright.c
index 77fd13b63..cc9821760 100644
--- a/typing-break/drwright.c
+++ b/typing-break/drwright.c
@@ -21,17 +21,22 @@
*/
#include <config.h>
+
+#include "drwright.h"
+
#include <time.h>
#include <string.h>
#include <math.h>
+
+#include <glib/gi18n.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <libgnomeui/gnome-stock-icons.h>
#include <libgnomeui/gnome-client.h>
-#include <libgnome/gnome-i18n.h>
+
#include <gconf/gconf-client.h>
-#include "drwright.h"
+
#include "drw-break-window.h"
#include "drw-monitor.h"
#include "drw-utils.h"
@@ -139,7 +144,6 @@ static GtkItemFactoryEntry popup_items[] = {
{ N_("/_Take a Break"), NULL, GIF_CB (popup_break_cb), POPUP_ITEM_BREAK, "<Item>", NULL }
};
-GConfClient *client = NULL;
extern gboolean debug;
static void
@@ -911,6 +915,7 @@ drwright_new (void)
{
DrWright *dr;
GtkWidget *item;
+ GConfClient *client;
dr = g_new0 (DrWright, 1);
@@ -940,6 +945,8 @@ drwright_new (void)
GCONF_PATH "/enabled",
NULL);
+ g_object_unref (client);
+
if (debug) {
setup_debug_values (dr);
}
diff --git a/vfs-methods/fontilus/font-view.c b/vfs-methods/fontilus/font-view.c
index 686229e71..ba4816a1e 100644
--- a/vfs-methods/fontilus/font-view.c
+++ b/vfs-methods/fontilus/font-view.c
@@ -21,18 +21,6 @@
# include <config.h>
#endif
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# define _(String) gettext(String)
-# define N_(String) gettext_noop(String)
-#else
-# define _(String) (String)
-# define N_(String) (String)
-# define textdomain(String) (String)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define bind_textdomain_codeset(Domain,Codeset) (Domain)
-#endif
-
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_TYPE1_TABLES_H
@@ -40,11 +28,13 @@
#include FT_TRUETYPE_IDS_H
#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
+
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <libgnomevfs/gnome-vfs.h>
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-#include <libgnomeui/libgnomeui.h>
+#include <libgnomeui/gnome-icon-lookup.h>
FT_Error FT_New_Face_From_URI(FT_Library library,
const gchar *uri,
diff --git a/vfs-methods/themus/themus-theme-applier.c b/vfs-methods/themus/themus-theme-applier.c
index c92915fad..b6a6fe563 100644
--- a/vfs-methods/themus/themus-theme-applier.c
+++ b/vfs-methods/themus/themus-theme-applier.c
@@ -19,6 +19,7 @@
#include <stdlib.h>
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <libgnome/libgnome.h>
@@ -34,7 +35,6 @@ int main (int argc, char **argv)
{
GnomeVFSURI *uri;
GnomeThemeMetaInfo *theme;
- GConfClient *client;
GnomeProgram *program;
GladeXML *font_xml;
GtkWidget *font_dialog;
@@ -90,8 +90,9 @@ int main (int argc, char **argv)
gnome_meta_theme_set (theme);
if (apply_font) {
- client = gconf_client_get_default ();
+ GConfClient *client = gconf_client_get_default ();
gconf_client_set_string (client, FONT_KEY, theme->application_font, NULL);
+ g_object_unref (client);
}
return 0;