aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-cal-shell-sidebar.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-11-02 23:49:38 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2010-11-10 06:33:22 +0800
commitdce5bdc3699faf592453492fe201606ed47e06b9 (patch)
treef533fe0d3ac9d6d75251ba5e6b1d48fcd9ab5a58 /modules/calendar/e-cal-shell-sidebar.c
parente3a09eb67c1f9b2a3762626eafbd9dec94bc63bf (diff)
downloadgsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.gz
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.bz2
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.lz
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.xz
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.tar.zst
gsoc2013-evolution-dce5bdc3699faf592453492fe201606ed47e06b9.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.c27
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. */