summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-09-05 19:08:00 +0200
committerStefano Karapetsas <[email protected]>2012-09-05 19:08:00 +0200
commit12e085081592626b01721bebd07c22b69d1b4262 (patch)
treece0a6cd7d3fc368807b12121381ca095171ff3be
parentd66d6c4b4f07b9a18a81b0ac369a779c74af6e39 (diff)
downloadcaja-12e085081592626b01721bebd07c22b69d1b4262.tar.bz2
caja-12e085081592626b01721bebd07c22b69d1b4262.tar.xz
convert icon-view preferences to gsettings
-rw-r--r--libcaja-private/caja-file.c9
-rw-r--r--libcaja-private/caja-global-preferences.c72
-rw-r--r--libcaja-private/caja-global-preferences.h21
-rw-r--r--libcaja-private/caja-icon-container.c21
-rw-r--r--libcaja-private/caja-thumbnails.c5
-rw-r--r--src/caja-file-management-properties.c37
-rw-r--r--src/file-manager/fm-desktop-icon-view.c18
-rw-r--r--src/file-manager/fm-directory-view.c10
-rw-r--r--src/file-manager/fm-icon-container.c6
-rw-r--r--src/file-manager/fm-icon-view.c95
10 files changed, 147 insertions, 147 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index 0a2d8833..2227ac2c 100644
--- a/libcaja-private/caja-file.c
+++ b/libcaja-private/caja-file.c
@@ -8174,7 +8174,7 @@ thumbnail_limit_changed_callback (gpointer user_data)
static void
thumbnail_size_changed_callback (gpointer user_data)
{
- cached_thumbnail_size = eel_preferences_get_integer (CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE);
+ cached_thumbnail_size = g_settings_get_int (caja_icon_view_preferences, CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE);
/* Tell the world that icons might have changed. We could invent a narrower-scope
* signal to mean only "thumbnails might have changed" if this ends up being slow
@@ -8288,9 +8288,10 @@ caja_file_class_init (CajaFileClass *class)
G_CALLBACK (thumbnail_limit_changed_callback),
NULL);
thumbnail_size_changed_callback (NULL);
- eel_preferences_add_callback (CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
- thumbnail_size_changed_callback,
- NULL);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
+ G_CALLBACK (thumbnail_size_changed_callback),
+ NULL);
show_thumbnails_changed_callback (NULL);
g_signal_connect_swapped (caja_preferences,
"changed::" CAJA_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
diff --git a/libcaja-private/caja-global-preferences.c b/libcaja-private/caja-global-preferences.c
index 27e3a543..1111e9d3 100644
--- a/libcaja-private/caja-global-preferences.c
+++ b/libcaja-private/caja-global-preferences.c
@@ -180,67 +180,11 @@ typedef struct
static const PreferenceDefault preference_defaults[] =
{
{
- CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
- PREFERENCE_STRING_ARRAY,
- "size,date_modified,type",
- NULL, NULL,
- NULL
- },
- {
CAJA_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
PREFERENCE_BOOLEAN,
GINT_TO_POINTER (TRUE)
},
- /* Icon View Default Preferences */
- {
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
- PREFERENCE_STRING,
- "name",
- NULL, NULL,
- "default_icon_view_sort_order"
- },
- {
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT,
- PREFERENCE_STRING,
- "name",
- NULL, NULL,
- "default_icon_view_sort_order"
- },
- {
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
- PREFERENCE_BOOLEAN,
- GINT_TO_POINTER (FALSE)
- },
- {
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
- PREFERENCE_BOOLEAN,
- GINT_TO_POINTER (FALSE)
- },
- {
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
- PREFERENCE_BOOLEAN,
- GINT_TO_POINTER (FALSE)
- },
- {
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- PREFERENCE_STRING,
- "standard",
- NULL, NULL,
- "default_zoom_level"
- },
- {
- CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
- PREFERENCE_INTEGER,
- GINT_TO_POINTER (96)
- },
- {
- CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT,
- PREFERENCE_STRING_ARRAY,
- "3",
- NULL,NULL,
- NULL,
- },
/* Compact Icon View Default Preferences */
{
CAJA_PREFERENCES_COMPACT_VIEW_DEFAULT_ZOOM_LEVEL,
@@ -550,7 +494,8 @@ default_icon_view_sort_order_or_manual_layout_changed_callback (gpointer callbac
int default_sort_order;
default_sort_order_or_manual_layout =
- eel_preferences_get_enum (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT);
+ g_settings_get_enum (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT);
eel_preferences_set_boolean (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
default_sort_order_or_manual_layout == PREFERENCES_SORT_ORDER_MANUALLY);
@@ -562,8 +507,9 @@ default_icon_view_sort_order_or_manual_layout_changed_callback (gpointer callbac
g_return_if_fail (default_sort_order >= CAJA_FILE_SORT_BY_DISPLAY_NAME);
g_return_if_fail (default_sort_order <= CAJA_FILE_SORT_BY_EMBLEMS);
- eel_preferences_set_enum (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
- default_sort_order);
+ g_settings_set_enum (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
+ default_sort_order);
}
}
@@ -596,11 +542,13 @@ caja_global_preferences_init (void)
caja_preferences = g_settings_new("org.mate.caja.preferences");
caja_media_preferences = g_settings_new("org.mate.media-handling");
caja_window_state = g_settings_new("org.mate.caja.window-state");
+ caja_icon_view_preferences = g_settings_new("org.mate.caja.icon-view");
/* Set up storage for values accessed in this file */
- eel_preferences_add_callback (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT,
- default_icon_view_sort_order_or_manual_layout_changed_callback,
- NULL);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT,
+ G_CALLBACK (default_icon_view_sort_order_or_manual_layout_changed_callback),
+ NULL);
/* Preload everything in a big batch */
eel_mateconf_preload_cache ("/apps/caja/preferences",
diff --git a/libcaja-private/caja-global-preferences.h b/libcaja-private/caja-global-preferences.h
index fd15293e..6ad73d18 100644
--- a/libcaja-private/caja-global-preferences.h
+++ b/libcaja-private/caja-global-preferences.h
@@ -135,13 +135,13 @@ G_BEGIN_DECLS
/* Icon View */
-#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER "icon_view/default_sort_in_reverse_order"
-#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER "icon_view/default_sort_order"
-#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT "icon_view/default_use_tighter_layout"
-#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL "icon_view/default_zoom_level"
-#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT "icon_view/default_use_manual_layout"
+#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER "default-sort-in-reverse-order"
+#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER "default-sort-order"
+#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT "default-use-tighter-layout"
+#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL "default-zoom-level"
+#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT "default-use-manual-layout"
-#define CAJA_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS "icon_view/labels_beside_icons"
+#define CAJA_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS "labels-beside-icons"
/* The icon view uses 2 variables to store the sort order and
@@ -151,16 +151,16 @@ G_BEGIN_DECLS
* In caja-global-preferences.c we install callbacks for
* the proxy preference and update the other 2 when it changes
*/
-#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT "icon_view/default_sort_order_or_manual_layout"
+#define CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT "default-sort-order-or-manual-layout"
/* Which text attributes appear beneath icon names */
-#define CAJA_PREFERENCES_ICON_VIEW_CAPTIONS "icon_view/captions"
+#define CAJA_PREFERENCES_ICON_VIEW_CAPTIONS "captions"
/* The default size for thumbnail icons */
-#define CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE "icon_view/thumbnail_size"
+#define CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE "thumbnail-size"
/* ellipsization preferences */
-#define CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT "icon_view/text_ellipsis_limit"
+#define CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT "text-ellipsis-limit"
#define CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT "desktop/text_ellipsis_limit"
/* Compact View */
@@ -229,6 +229,7 @@ char *caja_global_preferences_get_default_folder_viewer_preference_as_iid (void)
GSettings *caja_preferences;
GSettings *caja_media_preferences;
GSettings *caja_window_state;
+GSettings *caja_icon_view_preferences;
G_END_DECLS
diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c
index 39aab446..fa9651b7 100644
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -216,6 +216,7 @@ static void caja_icon_container_set_rtl_positions (CajaIconContainer *conta
static double get_mirror_x_position (CajaIconContainer *container,
CajaIcon *icon,
double x);
+static void text_ellipsis_limit_changed_container_callback (gpointer callback_data);
static int compare_icons_horizontal (CajaIconContainer *container,
CajaIcon *icon_a,
@@ -4452,6 +4453,10 @@ finalize (GObject *object)
details = CAJA_ICON_CONTAINER (object)->details;
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ text_ellipsis_limit_changed_container_callback,
+ object);
+
g_hash_table_destroy (details->icon_set);
details->icon_set = NULL;
@@ -6203,9 +6208,10 @@ caja_icon_container_constructor (GType type,
}
else
{
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT,
- text_ellipsis_limit_changed_container_callback,
- container, G_OBJECT (container));
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT,
+ G_CALLBACK (text_ellipsis_limit_changed_container_callback),
+ container);
}
return object;
@@ -6815,7 +6821,7 @@ text_ellipsis_limit_changed_callback (gpointer callback_data)
const EelEnumeration *eenum;
const EelEnumerationEntry *entry;
- pref = eel_preferences_get_string_array (CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT);
+ pref = g_settings_get_strv (caja_icon_view_preferences, CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT);
/* set default */
get_text_ellipsis_limit_for_zoom (pref, NULL, &one_limit);
@@ -6890,9 +6896,10 @@ caja_icon_container_init (CajaIconContainer *container)
if (!setup_prefs)
{
- eel_preferences_add_callback (CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT,
- text_ellipsis_limit_changed_callback,
- NULL);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT,
+ G_CALLBACK (text_ellipsis_limit_changed_callback),
+ NULL);
text_ellipsis_limit_changed_callback (NULL);
eel_preferences_add_callback (CAJA_PREFERENCES_DESKTOP_TEXT_ELLIPSIS_LIMIT,
diff --git a/libcaja-private/caja-thumbnails.c b/libcaja-private/caja-thumbnails.c
index 7034fe34..d1c52561 100644
--- a/libcaja-private/caja-thumbnails.c
+++ b/libcaja-private/caja-thumbnails.c
@@ -455,8 +455,9 @@ get_pixbuf_from_data (const unsigned char *buffer,
if (thumbnail_icon_size == 0)
{
- eel_preferences_add_auto_integer (CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
- &thumbnail_icon_size);
+ eel_g_settings_add_auto_int (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
+ &thumbnail_icon_size);
}
loader = gdk_pixbuf_loader_new ();
diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c
index 2fa8f9bb..1e2b91db 100644
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -375,8 +375,9 @@ icon_captions_changed_callback (GtkComboBox *combo_box,
}
g_ptr_array_add (captions, NULL);
- eel_preferences_set_string_array (CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
- (char **)captions->pdata);
+ g_settings_set_strv (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
+ (const char **)captions->pdata);
g_ptr_array_free (captions, TRUE);
}
@@ -420,7 +421,7 @@ update_icon_captions_from_mateconf (GtkBuilder *builder)
char **captions;
int i, j;
- captions = eel_preferences_get_string_array (CAJA_PREFERENCES_ICON_VIEW_CAPTIONS);
+ captions = g_settings_get_strv (caja_icon_view_preferences, CAJA_PREFERENCES_ICON_VIEW_CAPTIONS);
if (captions == NULL)
return;
@@ -455,7 +456,7 @@ caja_file_management_properties_dialog_setup_icon_caption_page (GtkBuilder *buil
int i;
gboolean writable;
- writable = eel_preferences_key_is_writable (CAJA_PREFERENCES_ICON_VIEW_CAPTIONS);
+ writable = g_settings_is_writable (caja_icon_view_preferences, CAJA_PREFERENCES_ICON_VIEW_CAPTIONS);
columns = caja_get_common_columns ();
@@ -955,12 +956,12 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi
create_date_format_menu (builder);
/* setup preferences */
- eel_preferences_builder_connect_bool (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_COMPACT_LAYOUT_WIDGET,
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT);
- eel_preferences_builder_connect_bool (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_LABELS_BESIDE_ICONS_WIDGET,
- CAJA_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS);
+ bind_builder_bool (builder, caja_icon_view_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_COMPACT_LAYOUT_WIDGET,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT);
+ bind_builder_bool (builder, caja_icon_view_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_LABELS_BESIDE_ICONS_WIDGET,
+ CAJA_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS);
eel_preferences_builder_connect_bool (builder,
CAJA_FILE_MANAGEMENT_PROPERTIES_ALL_COLUMNS_SAME_WIDTH,
CAJA_PREFERENCES_COMPACT_VIEW_ALL_COLUMNS_SAME_WIDTH);
@@ -996,10 +997,10 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi
CAJA_FILE_MANAGEMENT_PROPERTIES_DEFAULT_VIEW_WIDGET,
CAJA_PREFERENCES_DEFAULT_FOLDER_VIEWER,
(const char **) default_view_values);
- eel_preferences_builder_connect_string_enum_combo_box (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_ICON_VIEW_ZOOM_WIDGET,
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- (const char **) zoom_values);
+ bind_builder_enum (builder, caja_icon_view_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_ICON_VIEW_ZOOM_WIDGET,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
+ (const char **) zoom_values);
eel_preferences_builder_connect_string_enum_combo_box (builder,
CAJA_FILE_MANAGEMENT_PROPERTIES_COMPACT_VIEW_ZOOM_WIDGET,
CAJA_PREFERENCES_COMPACT_VIEW_DEFAULT_ZOOM_LEVEL,
@@ -1008,10 +1009,10 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi
CAJA_FILE_MANAGEMENT_PROPERTIES_LIST_VIEW_ZOOM_WIDGET,
CAJA_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
(const char **) zoom_values);
- eel_preferences_builder_connect_string_enum_combo_box (builder,
- CAJA_FILE_MANAGEMENT_PROPERTIES_SORT_ORDER_WIDGET,
- CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
- (const char **) sort_order_values);
+ bind_builder_enum (builder, caja_icon_view_preferences,
+ CAJA_FILE_MANAGEMENT_PROPERTIES_SORT_ORDER_WIDGET,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
+ (const char **) sort_order_values);
eel_preferences_builder_connect_string_enum_combo_box_slave (builder,
CAJA_FILE_MANAGEMENT_PROPERTIES_SORT_ORDER_WIDGET,
CAJA_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER);
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c
index 86d1cce6..ca9de561 100644
--- a/src/file-manager/fm-desktop-icon-view.c
+++ b/src/file-manager/fm-desktop-icon-view.c
@@ -300,9 +300,9 @@ fm_desktop_icon_view_finalize (GObject *object)
icon_view = FM_DESKTOP_ICON_VIEW (object);
- eel_preferences_remove_callback (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- default_zoom_level_changed,
- icon_view);
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ default_zoom_level_changed,
+ icon_view);
eel_preferences_remove_callback (CAJA_PREFERENCES_LOCKDOWN_COMMAND_LINE,
lockdown_disable_command_line_changed_callback,
@@ -432,8 +432,9 @@ get_default_zoom_level (void)
if (!auto_storage_added)
{
auto_storage_added = TRUE;
- eel_preferences_add_auto_enum (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- (int *) &default_zoom_level);
+ eel_g_settings_add_auto_enum (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
+ (int *) &default_zoom_level);
}
return CLAMP (default_zoom_level, CAJA_ZOOM_LEVEL_SMALLEST, CAJA_ZOOM_LEVEL_LARGEST);
@@ -615,9 +616,10 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
g_signal_connect_object (desktop_icon_view, "unrealize",
G_CALLBACK (unrealized_callback), desktop_icon_view, 0);
- eel_preferences_add_callback (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- default_zoom_level_changed,
- desktop_icon_view);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
+ G_CALLBACK (default_zoom_level_changed),
+ desktop_icon_view);
eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_DESKTOP_FONT,
font_changed_callback,
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index a678ec88..19245973 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -2041,8 +2041,10 @@ fm_directory_view_init (FMDirectoryView *view)
eel_preferences_add_callback (CAJA_PREFERENCES_ENABLE_DELETE,
schedule_update_menus_callback, view);
- eel_preferences_add_callback (CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
- text_attribute_names_changed_callback, view);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
+ G_CALLBACK(text_attribute_names_changed_callback),
+ view);
g_signal_connect_swapped (caja_preferences,
"changed::" CAJA_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
G_CALLBACK (image_display_policy_changed_callback),
@@ -2176,8 +2178,8 @@ fm_directory_view_finalize (GObject *object)
eel_preferences_remove_callback (CAJA_PREFERENCES_ENABLE_DELETE,
schedule_update_menus_callback, view);
- eel_preferences_remove_callback (CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
- text_attribute_names_changed_callback, view);
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ text_attribute_names_changed_callback, view);
g_signal_handlers_disconnect_by_func (caja_preferences,
image_display_policy_changed_callback, view);
g_signal_handlers_disconnect_by_func (caja_preferences,
diff --git a/src/file-manager/fm-icon-container.c b/src/file-manager/fm-icon-container.c
index 8cd3d357..0ecc0180 100644
--- a/src/file-manager/fm-icon-container.c
+++ b/src/file-manager/fm-icon-container.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
+#include <eel/eel-glib-extensions.h>
#include <libcaja-private/caja-global-preferences.h>
#include <libcaja-private/caja-file-attributes.h>
#include <libcaja-private/caja-thumbnails.h>
@@ -208,8 +209,9 @@ fm_icon_container_get_icon_text_attributes_from_preferences (void)
if (attributes == NULL)
{
- eel_preferences_add_auto_string_array_as_quarks (CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
- &attributes);
+ eel_g_settings_add_auto_strv_as_quarks (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_CAPTIONS,
+ &attributes);
}
/* We don't need to sanity check the attributes list even though it came
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index d5ab000e..3c70b2da 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -195,6 +195,12 @@ static void update_layout_menus (FMIconVie
static CajaFileSortType get_default_sort_order (CajaFile *file,
gboolean *reversed);
+static void default_sort_order_changed_callback (gpointer callback_data);
+static void default_sort_in_reverse_order_changed_callback (gpointer callback_data);
+static void default_use_tighter_layout_changed_callback (gpointer callback_data);
+static void default_use_manual_layout_changed_callback (gpointer callback_data);
+static void default_zoom_level_changed_callback (gpointer callback_data);
+static void labels_beside_icons_changed_callback (gpointer callback_data);
static void fm_icon_view_iface_init (CajaViewIface *iface);
@@ -244,6 +250,25 @@ fm_icon_view_finalize (GObject *object)
g_free (icon_view->details);
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ default_sort_order_changed_callback,
+ icon_view);
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ default_sort_in_reverse_order_changed_callback,
+ icon_view);
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ default_use_tighter_layout_changed_callback,
+ icon_view);
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ default_use_manual_layout_changed_callback,
+ icon_view);
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ default_zoom_level_changed_callback,
+ icon_view);
+ g_signal_handlers_disconnect_by_func (caja_icon_view_preferences,
+ labels_beside_icons_changed_callback,
+ icon_view);
+
G_OBJECT_CLASS (fm_icon_view_parent_class)->finalize (object);
}
@@ -799,11 +824,12 @@ get_default_sort_order (CajaFile *file, gboolean *reversed)
if (auto_storaged_added == FALSE)
{
auto_storaged_added = TRUE;
- eel_preferences_add_auto_enum (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
- (int *) &default_sort_order);
- eel_preferences_add_auto_boolean (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
- &default_sort_in_reverse_order);
-
+ eel_g_settings_add_auto_enum (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
+ (int *) &default_sort_order);
+ eel_g_settings_add_auto_boolean (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
+ &default_sort_in_reverse_order);
}
retval = caja_file_get_default_sort_type (file, reversed);
@@ -969,8 +995,9 @@ get_default_directory_manual_layout (void)
if (auto_storaged_added == FALSE)
{
auto_storaged_added = TRUE;
- eel_preferences_add_auto_boolean (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
- &default_directory_manual_layout);
+ eel_g_settings_add_auto_boolean (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
+ &default_directory_manual_layout);
}
return default_directory_manual_layout;
@@ -1056,8 +1083,9 @@ get_default_directory_tighter_layout (void)
if (auto_storaged_added == FALSE)
{
auto_storaged_added = TRUE;
- eel_preferences_add_auto_boolean (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
- &default_directory_tighter_layout);
+ eel_g_settings_add_auto_boolean (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
+ &default_directory_tighter_layout);
}
return default_directory_tighter_layout;
@@ -1206,8 +1234,9 @@ get_default_zoom_level (FMIconView *icon_view)
if (!auto_storage_added)
{
auto_storage_added = TRUE;
- eel_preferences_add_auto_enum (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- (int *) &default_zoom_level);
+ eel_g_settings_add_auto_enum (caja_icon_view_preferences,
+ CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
+ (int *) &default_zoom_level);
eel_preferences_add_auto_enum (CAJA_PREFERENCES_COMPACT_VIEW_DEFAULT_ZOOM_LEVEL,
(int *) &default_compact_zoom_level);
}
@@ -1223,7 +1252,7 @@ set_labels_beside_icons (FMIconView *icon_view)
if (fm_icon_view_supports_labels_beside_icons (icon_view))
{
labels_beside = fm_icon_view_is_compact (icon_view) ||
- eel_preferences_get_boolean (CAJA_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS);
+ g_settings_get_boolean (caja_icon_view_preferences, CAJA_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS);
if (labels_beside)
{
@@ -3290,24 +3319,30 @@ fm_icon_view_init (FMIconView *icon_view)
setup_sound_preview = TRUE;
}
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
- default_sort_order_changed_callback,
- icon_view, G_OBJECT (icon_view));
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
- default_sort_in_reverse_order_changed_callback,
- icon_view, G_OBJECT (icon_view));
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
- default_use_tighter_layout_changed_callback,
- icon_view, G_OBJECT (icon_view));
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
- default_use_manual_layout_changed_callback,
- icon_view, G_OBJECT (icon_view));
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- default_zoom_level_changed_callback,
- icon_view, G_OBJECT (icon_view));
- eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS,
- labels_beside_icons_changed_callback,
- icon_view, G_OBJECT (icon_view));
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
+ G_CALLBACK (default_sort_order_changed_callback),
+ icon_view);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_SORT_IN_REVERSE_ORDER,
+ G_CALLBACK (default_sort_in_reverse_order_changed_callback),
+ icon_view);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_TIGHTER_LAYOUT,
+ G_CALLBACK (default_use_tighter_layout_changed_callback),
+ icon_view);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_USE_MANUAL_LAYOUT,
+ G_CALLBACK (default_use_manual_layout_changed_callback),
+ icon_view);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
+ G_CALLBACK (default_zoom_level_changed_callback),
+ icon_view);
+ g_signal_connect_swapped (caja_icon_view_preferences,
+ "changed::" CAJA_PREFERENCES_ICON_VIEW_LABELS_BESIDE_ICONS,
+ G_CALLBACK (labels_beside_icons_changed_callback),
+ icon_view);
eel_preferences_add_callback_while_alive (CAJA_PREFERENCES_COMPACT_VIEW_DEFAULT_ZOOM_LEVEL,
default_zoom_level_changed_callback,