From 3b0699fc304d0f4aecb261d19869de221f5d6abf Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 7 Aug 2009 21:43:09 -0400 Subject: More refactoring of settings management. --- modules/calendar/e-memo-shell-sidebar.c | 50 ++++++++++----------------------- 1 file changed, 15 insertions(+), 35 deletions(-) (limited to 'modules/calendar/e-memo-shell-sidebar.c') diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index ca5d05c40b..0962a8a20d 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -25,6 +25,7 @@ #include #include +#include "e-util/e-binding.h" #include "e-util/e-error.h" #include "e-util/e-util.h" #include "calendar/common/authentication.h" @@ -41,6 +42,7 @@ struct _EMemoShellSidebarPrivate { GtkWidget *selector; + icaltimezone *timezone; /* UID -> Client */ GHashTable *client_table; @@ -89,33 +91,6 @@ memo_shell_sidebar_emit_status_message (EMemoShellSidebar *memo_shell_sidebar, g_signal_emit (memo_shell_sidebar, signal_id, 0, status_message, -1.0); } -static void -memo_shell_sidebar_update_timezone (EMemoShellSidebar *memo_shell_sidebar) -{ - GHashTable *client_table; - icaltimezone *zone; - GList *values; - - zone = calendar_config_get_icaltimezone (); - client_table = memo_shell_sidebar->priv->client_table; - values = g_hash_table_get_values (client_table); - - while (values != NULL) { - ECal *client = values->data; - - if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED) - e_cal_set_default_timezone (client, zone, NULL); - - values = g_list_delete_link (values, values); - } - - /* XXX Need to call e_cal_component_preview_set_default_timezone() - * here but the sidebar is not really supposed to access content - * stuff. I guess we could emit an "update-timezone" signal - * here, but that feels wrong. Maybe this whole thing should - * be in EMemoShellView instead. */ -} - static void memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar, ECal *client) @@ -482,13 +457,6 @@ memo_shell_sidebar_check_state (EShellSidebar *shell_sidebar) return state; } -static void -memo_shell_sidebar_client_added (EMemoShellSidebar *memo_shell_sidebar, - ECal *client) -{ - memo_shell_sidebar_update_timezone (memo_shell_sidebar); -} - static void memo_shell_sidebar_client_removed (EMemoShellSidebar *memo_shell_sidebar, ECal *client) @@ -532,7 +500,6 @@ memo_shell_sidebar_class_init (EMemoShellSidebarClass *class) shell_sidebar_class = E_SHELL_SIDEBAR_CLASS (class); shell_sidebar_class->check_state = memo_shell_sidebar_check_state; - class->client_added = memo_shell_sidebar_client_added; class->client_removed = memo_shell_sidebar_client_removed; g_object_class_install_property ( @@ -632,6 +599,19 @@ e_memo_shell_sidebar_new (EShellView *shell_view) "shell-view", shell_view, NULL); } +GList * +e_memo_shell_sidebar_get_clients (EMemoShellSidebar *memo_shell_sidebar) +{ + GHashTable *client_table; + + g_return_val_if_fail ( + E_IS_MEMO_SHELL_SIDEBAR (memo_shell_sidebar), NULL); + + client_table = memo_shell_sidebar->priv->client_table; + + return g_hash_table_get_values (client_table); +} + ESourceSelector * e_memo_shell_sidebar_get_selector (EMemoShellSidebar *memo_shell_sidebar) { -- cgit v1.2.3