summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-09-05 16:55:12 +0200
committerStefano Karapetsas <[email protected]>2012-09-05 16:55:12 +0200
commit562875c2ed80bd7501fb161564ab88c731ac497c (patch)
treece4641b88d670ada980feee9a0b109ee79660924
parent46925062b04255e723ff931ac82aefda9cfc516d (diff)
downloadcaja-562875c2ed80bd7501fb161564ab88c731ac497c.tar.bz2
caja-562875c2ed80bd7501fb161564ab88c731ac497c.tar.xz
convert show-directory-item-counts to gsettings
-rw-r--r--libcaja-private/caja-directory.c7
-rw-r--r--libcaja-private/caja-file.c9
-rw-r--r--libcaja-private/caja-global-preferences.c12
-rw-r--r--libcaja-private/caja-global-preferences.h2
-rw-r--r--src/caja-file-management-properties.c8
-rw-r--r--src/caja-sidebar-title.c11
6 files changed, 21 insertions, 28 deletions
diff --git a/libcaja-private/caja-directory.c b/libcaja-private/caja-directory.c
index 2318e409..faa6a22c 100644
--- a/libcaja-private/caja-directory.c
+++ b/libcaja-private/caja-directory.c
@@ -335,9 +335,10 @@ add_preferences_callbacks (void)
"changed::" CAJA_PREFERENCES_SHOW_TEXT_IN_ICONS,
G_CALLBACK (async_data_preference_changed_callback),
NULL);
- eel_preferences_add_callback (CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
- async_data_preference_changed_callback,
- NULL);
+ g_signal_connect_swapped (caja_preferences,
+ "changed::" CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
+ G_CALLBACK (async_data_preference_changed_callback),
+ NULL);
g_signal_connect_swapped (caja_preferences,
"changed::" CAJA_PREFERENCES_DATE_FORMAT,
G_CALLBACK(async_data_preference_changed_callback),
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index e923e895..52bfaa50 100644
--- a/libcaja-private/caja-file.c
+++ b/libcaja-private/caja-file.c
@@ -4700,7 +4700,7 @@ show_text_in_icons_changed_callback (gpointer callback_data)
static void
show_directory_item_count_changed_callback (gpointer callback_data)
{
- show_directory_item_count = eel_preferences_get_enum (CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS);
+ show_directory_item_count = g_settings_get_enum (caja_preferences, CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS);
}
static gboolean
@@ -4752,9 +4752,10 @@ caja_file_should_show_directory_item_count (CajaFile *file)
/* Add the callback once for the life of our process */
if (!show_directory_item_count_callback_added) {
- eel_preferences_add_callback (CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
- show_directory_item_count_changed_callback,
- NULL);
+ g_signal_connect_swapped (caja_preferences,
+ "changed::" CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
+ G_CALLBACK(show_directory_item_count_changed_callback),
+ NULL);
show_directory_item_count_callback_added = TRUE;
/* Peek for the first time */
diff --git a/libcaja-private/caja-global-preferences.c b/libcaja-private/caja-global-preferences.c
index ee7edb54..490a8d4d 100644
--- a/libcaja-private/caja-global-preferences.c
+++ b/libcaja-private/caja-global-preferences.c
@@ -187,18 +187,6 @@ typedef struct
*/
static const PreferenceDefault preference_defaults[] =
{
- /* Don't show remote directory item counts by default
- * because computing them can be annoyingly slow, especially
- * for FTP. If we make this fast enough for FTP in particular,
- * we should change this default to ALWAYS.
- */
- {
- CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
- PREFERENCE_STRING,
- "local_only",
- NULL, NULL,
- "speed_tradeoff"
- },
{
CAJA_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
PREFERENCE_STRING,
diff --git a/libcaja-private/caja-global-preferences.h b/libcaja-private/caja-global-preferences.h
index 6ffa0fdf..9f722214 100644
--- a/libcaja-private/caja-global-preferences.h
+++ b/libcaja-private/caja-global-preferences.h
@@ -199,7 +199,7 @@ G_BEGIN_DECLS
} CajaSpeedTradeoffValue;
#define CAJA_PREFERENCES_SHOW_TEXT_IN_ICONS "show-icon-text"
-#define CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS "preferences/show_directory_item_counts"
+#define CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS "show-directory-item-counts"
#define CAJA_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS "preferences/show_image_thumbnails"
#define CAJA_PREFERENCES_IMAGE_FILE_THUMBNAIL_LIMIT "preferences/thumbnail_limit"
#define CAJA_PREFERENCES_PREVIEW_SOUND "preferences/preview_sound"
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index f9e82af6..2b57f7a6 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -970,10 +970,10 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi
CAJA_FILE_MANAGEMENT_PROPERTIES_PREVIEW_SOUND_WIDGET,
CAJA_PREFERENCES_PREVIEW_SOUND,
(const char **) preview_values);
- eel_preferences_builder_connect_string_enum_combo_box (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_PREVIEW_FOLDER_WIDGET,
- CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
- (const char **) preview_values);
+ bind_builder_enum (builder, caja_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_PREVIEW_FOLDER_WIDGET,
+ CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
+ (const char **) preview_values);
bind_builder_enum (builder, caja_preferences,
CAJA_FILE_MANAGEMENT_PROPERTIES_DATE_FORMAT_WIDGET,
CAJA_PREFERENCES_DATE_FORMAT,
diff --git a/src/caja-sidebar-title.c b/src/caja-sidebar-title.c
index 1e334677..15a761be 100644
--- a/src/caja-sidebar-title.c
+++ b/src/caja-sidebar-title.c
@@ -165,10 +165,10 @@ caja_sidebar_title_init (CajaSidebarTitle *sidebar_title)
/* initialize the label colors & fonts */
style_set (GTK_WIDGET (sidebar_title), NULL);
- eel_preferences_add_callback_while_alive (
- CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
- (EelPreferencesCallback) update_more_info,
- sidebar_title, G_OBJECT (sidebar_title));
+ g_signal_connect_swapped (caja_preferences,
+ "changed::" CAJA_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS,
+ G_CALLBACK(update_more_info),
+ sidebar_title);
}
/* destroy by throwing away private storage */
@@ -206,6 +206,9 @@ caja_sidebar_title_destroy (GtkObject *object)
sidebar_title->details = NULL;
}
+ g_signal_handlers_disconnect_by_func (caja_preferences,
+ update_more_info, sidebar_title);
+
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}