diff options
author | Stefano Karapetsas <[email protected]> | 2012-09-05 14:00:24 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-09-05 14:00:24 +0200 |
commit | 8e8764286d4a3f65839dfdd4019b4f22fe3eabe4 (patch) | |
tree | 5578c080dc56f6698edd565b9313c8d3ce334838 /eel/eel-glib-extensions.c | |
parent | cf3e02237f89593e6e03065ced3af2835e915ee0 (diff) | |
download | caja-8e8764286d4a3f65839dfdd4019b4f22fe3eabe4.tar.bz2 caja-8e8764286d4a3f65839dfdd4019b4f22fe3eabe4.tar.xz |
convert date-format to gsettings
add eel_g_settings_add_auto_enum in eel/eel-glib-extensions.c
Diffstat (limited to 'eel/eel-glib-extensions.c')
-rw-r--r-- | eel/eel-glib-extensions.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/eel/eel-glib-extensions.c b/eel/eel-glib-extensions.c index 80180054..1014c2b0 100644 --- a/eel/eel-glib-extensions.c +++ b/eel/eel-glib-extensions.c @@ -1024,6 +1024,30 @@ eel_get_filename_charset (const gchar **filename_charset) return cache->is_utf8; } +static void +update_auto_enum (GSettings *settings, + const gchar *key, + gpointer user_data) +{ + int *storage = user_data; + + *storage = g_settings_get_enum (settings, key); +} + +void +eel_g_settings_add_auto_enum (GSettings *settings, + const char *key, + int *storage) +{ + char *signal; + + *storage = g_settings_get_enum (settings, key); + signal = g_strconcat ("changed::", key, NULL); + g_signal_connect (settings, signal, + G_CALLBACK(update_auto_enum), + storage); +} + #if !defined (EEL_OMIT_SELF_CHECK) static void |