diff options
Diffstat (limited to 'modules/calendar/e-cal-shell-backend.c')
-rw-r--r-- | modules/calendar/e-cal-shell-backend.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 5693994277..af1ca215fd 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -901,18 +901,24 @@ e_cal_shell_backend_get_source_list (ECalShellBackend *cal_shell_backend) GSList * e_cal_shell_backend_get_selected_calendars (ECalShellBackend *cal_shell_backend) { - GConfClient *client; - GSList *selected_calendars; - const gchar *key; + GSettings *settings; + GSList *selected_calendars = NULL; + gchar **strv; + gint ii; g_return_val_if_fail ( E_IS_CAL_SHELL_BACKEND (cal_shell_backend), NULL); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/display/selected_calendars"; - selected_calendars = gconf_client_get_list ( - client, key, GCONF_VALUE_STRING, NULL); - g_object_unref (client); + settings = g_settings_new ("org.gnome.evolution.calendar"); + strv = g_settings_get_strv (settings, "selected-calendars"); + g_object_unref (settings); + + if (strv != NULL) { + for (ii = 0; strv[ii] != NULL; ii++) + selected_calendars = g_slist_append (selected_calendars, g_strdup (strv[ii])); + + g_strfreev (strv); + } return selected_calendars; } @@ -921,16 +927,21 @@ void e_cal_shell_backend_set_selected_calendars (ECalShellBackend *cal_shell_backend, GSList *selected_calendars) { - GConfClient *client; - const gchar *key; + GSettings *settings; + GSList *link; + GPtrArray *array = g_ptr_array_new (); g_return_if_fail (E_IS_CAL_SHELL_BACKEND (cal_shell_backend)); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/display/selected_calendars"; - gconf_client_set_list ( - client, key, GCONF_VALUE_STRING, selected_calendars, NULL); - g_object_unref (client); + for (link = selected_calendars; link != NULL; link = link->next) + g_ptr_array_add (array, link->data); + g_ptr_array_add (array, NULL); + + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_strv (settings, "selected-calendars", (const gchar *const *) array->pdata); + g_object_unref (settings); + + g_ptr_array_free (array, FALSE); } void |