aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/modules/e-cal-shell-sidebar.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-04-26 07:37:21 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-04-26 07:37:21 +0800
commitd261d0b2e46d4793c2d54540782552846535eb60 (patch)
tree5e37dd30639f8ae27c298ccdbbe4cb18d79b0830 /calendar/modules/e-cal-shell-sidebar.c
parentdc7efb1311d23c32a76a9a8092f734223ce3207e (diff)
downloadgsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.gz
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.bz2
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.lz
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.xz
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.tar.zst
gsoc2013-evolution-d261d0b2e46d4793c2d54540782552846535eb60.zip
Begin migrating calendar settings to EShellSettings.
Begin dismantling calendar-config.c and migrating calendar settings to EShellSettings. EShellSettings utilizes GObject properties instead of separate get/set/notify functions for each setting.
Diffstat (limited to 'calendar/modules/e-cal-shell-sidebar.c')
-rw-r--r--calendar/modules/e-cal-shell-sidebar.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/calendar/modules/e-cal-shell-sidebar.c b/calendar/modules/e-cal-shell-sidebar.c
index ee887cecba..61a1a727e6 100644
--- a/calendar/modules/e-cal-shell-sidebar.c
+++ b/calendar/modules/e-cal-shell-sidebar.c
@@ -272,8 +272,12 @@ static void
cal_shell_sidebar_primary_selection_changed_cb (ECalShellSidebar *cal_shell_sidebar,
ESourceSelector *selector)
{
+ EShell *shell;
+ EShellView *shell_view;
+ EShellWindow *shell_window;
+ EShellSidebar *shell_sidebar;
+ EShellSettings *shell_settings;
ESource *source;
- const gchar *uid;
/* XXX ESourceSelector needs a "primary-selection-uid" property
* so we can just bind the property with GConfBridge. */
@@ -282,8 +286,16 @@ cal_shell_sidebar_primary_selection_changed_cb (ECalShellSidebar *cal_shell_side
if (source == NULL)
return;
- uid = e_source_peek_uid (source);
- calendar_config_set_primary_calendar (uid);
+ shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar);
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ shell = e_shell_window_get_shell (shell_window);
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ e_shell_settings_set_string (
+ shell_settings, "cal-primary-calendar",
+ e_source_peek_uid (source));
}
static void
@@ -359,8 +371,11 @@ static void
cal_shell_sidebar_constructed (GObject *object)
{
ECalShellSidebarPrivate *priv;
+ EShell *shell;
EShellView *shell_view;
+ EShellWindow *shell_window;
EShellSidebar *shell_sidebar;
+ EShellSettings *shell_settings;
ECalShellView *cal_shell_view;
ESourceSelector *selector;
ESourceList *source_list;
@@ -382,6 +397,11 @@ cal_shell_sidebar_constructed (GObject *object)
shell_sidebar = E_SHELL_SIDEBAR (object);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ shell = e_shell_window_get_shell (shell_window);
+ shell_settings = e_shell_get_shell_settings (shell);
+
cal_shell_view = E_CAL_SHELL_VIEW (shell_view);
source_list = e_cal_shell_view_get_source_list (cal_shell_view);
@@ -437,7 +457,8 @@ cal_shell_sidebar_constructed (GObject *object)
object);
source = NULL;
- uid = calendar_config_get_primary_calendar ();
+ uid = e_shell_settings_get_string (
+ shell_settings, "cal-primary-calendar");
if (uid != NULL)
source = e_source_list_peek_source_by_uid (source_list, uid);
if (source == NULL)