diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2004-04-05 19:17:43 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-04-05 19:17:43 +0800 |
commit | 4909b5ff6de4c14cc399aa9a94030fb0170e8a19 (patch) | |
tree | cff735b6f37f9708f08bd333ca310ce56537fb7b /calendar/gui/dialogs/comp-editor.c | |
parent | e2f581c52b016a6d62cbde62c3b69a149e813956 (diff) | |
download | gsoc2013-evolution-4909b5ff6de4c14cc399aa9a94030fb0170e8a19.tar.gz gsoc2013-evolution-4909b5ff6de4c14cc399aa9a94030fb0170e8a19.tar.zst gsoc2013-evolution-4909b5ff6de4c14cc399aa9a94030fb0170e8a19.zip |
Fixes #56316
2004-04-05 Rodrigo Moya <rodrigo@ximian.com>
Fixes #56316
* gui/dialogs/comp-editor-page.[ch]: added "fill_timezones" virtual
method to CompEditorPage class.
(comp_editor_page_fill_timezones): new function.
(comp_editor_page_class_init): initialize new virtual method.
* gui/dialogs/event-page.c (event_page_fill_timezones,
event_page_class_init):
* gui/dialogs/task-page.c (task_page_fill_timezones,
task_page_class_init):
* gui/dialogs/task-details-page.c (task_details_page_fill_timezones,
task_details_page_class_init): implemented new virtual method for pages
dealing with timezones.
* gui/dialogs/comp-editor.c (save_comp): call the "fill_timezones"
method on all pages, and call...
(send_timezone): ...this function for each hash table item.
svn path=/trunk/; revision=25314
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index d204de56e8..27f55cee68 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -352,6 +352,16 @@ listen_for_changes (CompEditor *editor) } } +static void +send_timezone (gpointer key, gpointer value, gpointer user_data) +{ + char *tzid = key; + icaltimezone *zone = value; + CompEditor *editor = user_data; + + e_cal_add_timezone (editor->priv->client, zone, NULL); +} + static gboolean save_comp (CompEditor *editor) { @@ -360,6 +370,7 @@ save_comp (CompEditor *editor) GList *l; gboolean result; GError *error = NULL; + GHashTable *timezones; const char *orig_uid; priv = editor->priv; @@ -367,13 +378,19 @@ save_comp (CompEditor *editor) if (!priv->changed) return TRUE; + timezones = g_hash_table_new (g_str_hash, g_str_equal); + clone = e_cal_component_clone (priv->comp); for (l = priv->pages; l != NULL; l = l->next) { if (!comp_editor_page_fill_component (l->data, clone)) { g_object_unref (clone); + g_hash_table_destroy (timezones); comp_editor_show_page (editor, COMP_EDITOR_PAGE (l->data)); return FALSE; } + + /* retrieve all timezones */ + comp_editor_page_fill_timezones (l->data, timezones); } /* If we are not the organizer, we don't update the sequence number */ @@ -389,6 +406,11 @@ save_comp (CompEditor *editor) e_cal_component_get_uid (priv->comp, &orig_uid); + /* send timezones */ + g_hash_table_foreach (timezones, (GHFunc) send_timezone, editor); + g_hash_table_destroy (timezones); + + /* send the component to the server */ if (!cal_comp_is_on_server (priv->comp, priv->client)) { result = e_cal_create_object (priv->client, e_cal_component_get_icalcomponent (priv->comp), NULL, &error); } else { |