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-sidebar.c | |
parent | 0ab70ad33c4e22a176e89bb8a935aed8c7848e51 (diff) | |
download | gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar.gz gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar.bz2 gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar.lz gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar.xz 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-sidebar.c')
-rw-r--r-- | modules/calendar/e-cal-shell-sidebar.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 66a1102cb7..1e291989cf 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -29,7 +29,6 @@ #include "widgets/misc/e-paned.h" #include "calendar/common/authentication.h" -#include "calendar/gui/calendar-config.h" #include "calendar/gui/e-calendar-selector.h" #include "calendar/gui/misc.h" #include "calendar/gui/dialogs/calendar-setup.h" @@ -382,12 +381,19 @@ static void cal_shell_sidebar_selection_changed_cb (ECalShellSidebar *cal_shell_sidebar, ESourceSelector *selector) { + EShellView *shell_view; + EShellBackend *shell_backend; + EShellSidebar *shell_sidebar; GSList *list, *iter; /* This signal is emitted less frequently than "row-changed", * especially when the model is being rebuilt. So we'll take * it easy on poor GConf. */ + shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_backend = e_shell_view_get_shell_backend (shell_view); + list = e_source_selector_get_selection (selector); for (iter = list; iter != NULL; iter = iter->next) { @@ -397,7 +403,8 @@ cal_shell_sidebar_selection_changed_cb (ECalShellSidebar *cal_shell_sidebar, g_object_unref (source); } - calendar_config_set_calendars_selected (list); + e_cal_shell_backend_set_selected_calendars ( + E_CAL_SHELL_BACKEND (shell_backend), list); g_slist_free (list); } @@ -467,19 +474,19 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window, g_object_ref (source_list), (GDestroyNotify) g_object_unref); - list = calendar_config_get_calendars_selected (); + list = e_cal_shell_backend_get_selected_calendars ( + E_CAL_SHELL_BACKEND (shell_backend)); + for (iter = list; iter != NULL; iter = iter->next) { - gchar *uid; + const gchar *uid = iter->data; - uid = iter->data; source = e_source_list_peek_source_by_uid (source_list, uid); - g_free (uid); - if (source == NULL) - continue; - - e_source_selector_select_source (selector, source); + if (source != NULL) + e_source_selector_select_source (selector, source); } + + g_slist_foreach (list, (GFunc) g_free, NULL); g_slist_free (list); /* Listen for subsequent changes to the selector. */ |