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-memo-shell-sidebar.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-memo-shell-sidebar.c')
-rw-r--r-- | modules/calendar/e-memo-shell-sidebar.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index 04292af2fd..5bc5dfd132 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -28,7 +28,6 @@ #include "e-util/e-alert-dialog.h" #include "e-util/e-util.h" #include "calendar/common/authentication.h" -#include "calendar/gui/calendar-config.h" #include "calendar/gui/e-memo-list-selector.h" #include "calendar/gui/misc.h" @@ -376,12 +375,19 @@ static void memo_shell_sidebar_selection_changed_cb (EMemoShellSidebar *memo_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 (memo_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) { @@ -391,7 +397,8 @@ memo_shell_sidebar_selection_changed_cb (EMemoShellSidebar *memo_shell_sidebar, g_object_unref (source); } - calendar_config_set_memos_selected (list); + e_memo_shell_backend_set_selected_memo_lists ( + E_MEMO_SHELL_BACKEND (shell_backend), list); g_slist_free (list); } @@ -458,19 +465,19 @@ memo_shell_sidebar_restore_state_cb (EShellWindow *shell_window, g_object_ref (source_list), (GDestroyNotify) g_object_unref); - list = calendar_config_get_memos_selected (); + list = e_memo_shell_backend_get_selected_memo_lists ( + E_MEMO_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. */ |