diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-11-02 23:49:38 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-11-05 02:19:50 +0800 |
commit | 1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b (patch) | |
tree | b8d9f8b56ce226ac15e7cc5efe0e36ad084f41af /modules/calendar/e-cal-shell-migrate.c | |
parent | 0ab70ad33c4e22a176e89bb8a935aed8c7848e51 (diff) | |
download | gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar.gz gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar.zst gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.zip |
Move calendar preferences to the calendar module.
Continue replacing the use of calendar-config functions with GObject
property bindings to EShellSettings properties.
Diffstat (limited to 'modules/calendar/e-cal-shell-migrate.c')
-rw-r--r-- | modules/calendar/e-cal-shell-migrate.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/modules/calendar/e-cal-shell-migrate.c b/modules/calendar/e-cal-shell-migrate.c index c1a7221597..d25228d98f 100644 --- a/modules/calendar/e-cal-shell-migrate.c +++ b/modules/calendar/e-cal-shell-migrate.c @@ -37,11 +37,12 @@ #include <libedataserver/e-xml-hash-utils.h> #include "e-util/e-util-private.h" -#include "calendar/gui/calendar-config.h" #include "calendar/gui/calendar-config-keys.h" #include "calendar/gui/e-cal-event.h" #include "shell/e-shell.h" +#include "e-cal-shell-backend.h" + #define WEBCAL_BASE_URI "webcal://" #define CONTACTS_BASE_URI "contacts://" #define BAD_CONTACTS_BASE_URI "contact://" @@ -150,6 +151,7 @@ create_calendar_sources (EShellBackend *shell_backend, } if (!*personal_source) { + GSList *selected; gchar *primary_calendar; /* Create the default Person calendar */ @@ -159,18 +161,26 @@ create_calendar_sources (EShellBackend *shell_backend, primary_calendar = e_shell_settings_get_string ( shell_settings, "cal-primary-calendar"); - if (!primary_calendar && !calendar_config_get_calendars_selected ()) { - GSList selected; + selected = e_cal_shell_backend_get_selected_calendars ( + E_CAL_SHELL_BACKEND (shell_backend)); + + if (primary_calendar == NULL && selected == NULL) { + GSList link; e_shell_settings_set_string ( shell_settings, "cal-primary-calendar", e_source_peek_uid (source)); - selected.data = (gpointer)e_source_peek_uid (source); - selected.next = NULL; - calendar_config_set_calendars_selected (&selected); + link.data = (gpointer)e_source_peek_uid (source); + link.next = NULL; + + e_cal_shell_backend_set_selected_calendars ( + E_CAL_SHELL_BACKEND (shell_backend), &link); } + g_slist_foreach (selected, (GFunc) g_free, NULL); + g_slist_free (selected); + g_free (primary_calendar); e_source_set_color_spec (source, "#BECEDD"); *personal_source = source; @@ -196,10 +206,10 @@ create_calendar_sources (EShellBackend *shell_backend, gboolean e_cal_shell_backend_migrate (EShellBackend *shell_backend, - gint major, - gint minor, - gint micro, - GError **error) + gint major, + gint minor, + gint micro, + GError **error) { ESourceGroup *on_this_computer = NULL, *on_the_web = NULL, *contacts = NULL; ESource *personal_source = NULL; |