From f14af6f9988ec850e5da566657163fdcdb22aeaf Mon Sep 17 00:00:00 2001 From: Dan Vrátil Date: Wed, 16 May 2012 19:02:42 +0200 Subject: Bug #675863 - Cannot load webview.css from Tasks/Memos --- calendar/gui/e-cal-component-preview.c | 4 ++-- modules/calendar/e-memo-shell-content.c | 28 ++++++++++++++++------------ modules/calendar/e-task-shell-content.c | 28 ++++++++++++++++------------ 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index 4b727d4d53..a1bfe92850 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -58,7 +58,7 @@ struct _ECalComponentPreviewPrivate { #define HTML_HEADER "\n\n" \ "\n\n" \ - "\n" \ + "\n" \ "\n" \ @@ -224,7 +224,7 @@ cal_component_preview_write_html (GString *buffer, uri = g_filename_to_uri (icon_file, NULL, NULL); g_string_append_printf ( - buffer, "\"%s\"", + buffer, "\"%s\"", category, uri); g_free (uri); } else { diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index 24f7a68d73..19dbf8e564 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -194,7 +194,6 @@ memo_shell_content_cursor_change_cb (EMemoShellContent *memo_shell_content, ECalComponentPreview *memo_preview; ECalModel *memo_model; ECalModelComponent *comp_data; - ECalComponent *comp; EPreviewPane *preview_pane; EWebView *web_view; const gchar *uid; @@ -206,26 +205,31 @@ memo_shell_content_cursor_change_cb (EMemoShellContent *memo_shell_content, memo_preview = E_CAL_COMPONENT_PREVIEW (web_view); if (e_table_selected_count (table) != 1) { - e_cal_component_preview_clear (memo_preview); + if (memo_shell_content->priv->preview_visible) + e_cal_component_preview_clear (memo_preview); return; } row = e_table_get_cursor_row (table); comp_data = e_cal_model_get_component_at (memo_model, row); - comp = e_cal_component_new (); - e_cal_component_set_icalcomponent ( - comp, icalcomponent_new_clone (comp_data->icalcomp)); - e_cal_component_preview_display ( - memo_preview, comp_data->client, comp, - e_cal_model_get_timezone (memo_model), - e_cal_model_get_use_24_hour_format (memo_model)); + if (memo_shell_content->priv->preview_visible) { + ECalComponent *comp; + + comp = e_cal_component_new_from_icalcomponent ( + icalcomponent_new_clone (comp_data->icalcomp)); - e_cal_component_get_uid (comp, &uid); + e_cal_component_preview_display ( + memo_preview, comp_data->client, comp, + e_cal_model_get_timezone (memo_model), + e_cal_model_get_use_24_hour_format (memo_model)); + + g_object_unref (comp); + } + + uid = icalcomponent_get_uid (comp_data->icalcomp); g_free (memo_shell_content->priv->current_uid); memo_shell_content->priv->current_uid = g_strdup (uid); - - g_object_unref (comp); } static void diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 0ebff795bf..8284a63446 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -194,7 +194,6 @@ task_shell_content_cursor_change_cb (ETaskShellContent *task_shell_content, ECalComponentPreview *task_preview; ECalModel *task_model; ECalModelComponent *comp_data; - ECalComponent *comp; EPreviewPane *preview_pane; EWebView *web_view; const gchar *uid; @@ -206,26 +205,31 @@ task_shell_content_cursor_change_cb (ETaskShellContent *task_shell_content, task_preview = E_CAL_COMPONENT_PREVIEW (web_view); if (e_table_selected_count (table) != 1) { - e_cal_component_preview_clear (task_preview); + if (task_shell_content->priv->preview_visible) + e_cal_component_preview_clear (task_preview); return; } row = e_table_get_cursor_row (table); comp_data = e_cal_model_get_component_at (task_model, row); - comp = e_cal_component_new (); - e_cal_component_set_icalcomponent ( - comp, icalcomponent_new_clone (comp_data->icalcomp)); - e_cal_component_preview_display ( - task_preview, comp_data->client, comp, - e_cal_model_get_timezone (task_model), - e_cal_model_get_use_24_hour_format (task_model)); + if (task_shell_content->priv->preview_visible) { + ECalComponent *comp; + + comp = e_cal_component_new_from_icalcomponent ( + icalcomponent_new_clone (comp_data->icalcomp)); - e_cal_component_get_uid (comp, &uid); + e_cal_component_preview_display ( + task_preview, comp_data->client, comp, + e_cal_model_get_timezone (task_model), + e_cal_model_get_use_24_hour_format (task_model)); + + g_object_unref (comp); + } + + uid = icalcomponent_get_uid (comp_data->icalcomp); g_free (task_shell_content->priv->current_uid); task_shell_content->priv->current_uid = g_strdup (uid); - - g_object_unref (comp); } static void -- cgit