diff options
Diffstat (limited to 'capplets')
-rw-r--r-- | capplets/about-me/e-image-chooser.c | 2 | ||||
-rw-r--r-- | capplets/accessibility/at-properties/at-startup-session.h | 3 | ||||
-rw-r--r-- | capplets/accessibility/keyboard/accessibility-keyboard.c | 3 | ||||
-rw-r--r-- | capplets/background/gnome-wp-info.c | 6 | ||||
-rw-r--r-- | capplets/common/gconf-property-editor.c | 17 | ||||
-rw-r--r-- | capplets/common/gnome-theme-apply.c | 1 | ||||
-rw-r--r-- | capplets/default-applications/gnome-default-applications-properties.c | 1 | ||||
-rw-r--r-- | capplets/keybindings/gnome-keybinding-properties.c | 13 | ||||
-rw-r--r-- | capplets/keyboard/gnome-keyboard-properties.c | 1 | ||||
-rw-r--r-- | capplets/mouse/gnome-mouse-properties.c | 28 | ||||
-rw-r--r-- | capplets/network/gnome-network-preferences.c | 5 | ||||
-rw-r--r-- | capplets/sound/sound-properties-capplet.c | 1 | ||||
-rw-r--r-- | capplets/theme-switcher/gnome-theme-details.c | 3 | ||||
-rw-r--r-- | capplets/theme-switcher/gnome-theme-manager.c | 12 | ||||
-rw-r--r-- | capplets/ui-properties/gnome-ui-properties.c | 12 | ||||
-rw-r--r-- | capplets/windows/gnome-window-properties.c | 4 |
16 files changed, 81 insertions, 31 deletions
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 ()); |