aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-09-21 22:23:40 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-21 22:23:40 +0800
commit2f76eec65ede46b0b90972db6499b0dd65e5e2ee (patch)
tree2c94b65eea419925034eaec94ecd285f1bfb1db5 /calendar
parentbba8d7cb91249cac440ca0a5ce3e9f380ac3a76d (diff)
downloadgsoc2013-evolution-2f76eec65ede46b0b90972db6499b0dd65e5e2ee.tar.gz
gsoc2013-evolution-2f76eec65ede46b0b90972db6499b0dd65e5e2ee.tar.zst
gsoc2013-evolution-2f76eec65ede46b0b90972db6499b0dd65e5e2ee.zip
Set day-second-zones in GSettings, not GConf
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/calendar-config.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index 1ae04af530..9623dcf058 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -339,6 +339,8 @@ calendar_config_set_day_second_zone (const gchar *location)
if (location && *location) {
GSList *lst, *l;
gint max_zones;
+ GPtrArray *array;
+ gint i;
/* configurable max number of timezones to remember */
max_zones = g_settings_get_int (config, "day-second-zones-max");
@@ -365,15 +367,14 @@ calendar_config_set_day_second_zone (const gchar *location)
lst = g_slist_prepend (lst, g_strdup (location));
}
- while (g_slist_length (lst) > max_zones) {
- l = g_slist_last (lst);
- g_free (l->data);
- lst = g_slist_delete_link (lst, l);
- }
+ array = g_ptr_array_new ();
+ for (i = 0, l = lst; i < max_zones && l != NULL; i++, l = l->next)
+ g_ptr_array_add (array, l->data);
- gconf_client_set_list (config, CALENDAR_CONFIG_DAY_SECOND_ZONES_LIST, GCONF_VALUE_STRING, lst, NULL);
+ g_settings_set_strv (config, "day-second-zones", array->pdata);
calendar_config_free_day_second_zones (lst);
+ g_ptr_array_free (array, FALSE);
}
g_settings_set_string (config, "day-second-zone", location ? location : "");