summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-icon-container.c
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 /libcaja-private/caja-icon-container.c
parentd66d6c4b4f07b9a18a81b0ac369a779c74af6e39 (diff)
downloadcaja-12e085081592626b01721bebd07c22b69d1b4262.tar.bz2
caja-12e085081592626b01721bebd07c22b69d1b4262.tar.xz
convert icon-view preferences to gsettings
Diffstat (limited to 'libcaja-private/caja-icon-container.c')
-rw-r--r--libcaja-private/caja-icon-container.c21
1 files changed, 14 insertions, 7 deletions
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,