Commit ca11c140 authored by Milan Crha's avatar Milan Crha

Port to libical-glib

parent d08053f5
......@@ -286,7 +286,7 @@ pkg_check_modules(GNOME_PLATFORM REQUIRED
pkg_check_modules(EVOLUTION_DATA_SERVER REQUIRED
camel-1.2>=${eds_minimum_version}
libebook-1.2>=${eds_minimum_version}
libecal-1.2>=${eds_minimum_version}
libecal-2.0>=${eds_minimum_version}
libedataserver-1.2>=${eds_minimum_version}
libedataserverui-1.2>=${eds_minimum_version}
libebackend-1.2>=${eds_minimum_version}
......@@ -589,49 +589,6 @@ set(HAVE_LIBNOTIFY ${LIBNOTIFY_FOUND})
pkg_check_modules(LIBUNITY unity>=${libunity_minimum_version})
set(HAVE_LIBUNITY ${LIBUNITY_FOUND})
# ******************************
# libical tweaks
# ******************************
set(CMAKE_REQUIRED_DEFINITIONS ${EVOLUTION_DATA_SERVER_CFLAGS_OTHER})
set(CMAKE_REQUIRED_INCLUDES ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${EVOLUTION_DATA_SERVER_LDFLAGS})
CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
int main(void) {
ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN);
return 0;
}" HAVE_ICAL_UNKNOWN_TOKEN_HANDLING)
CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
int main(void) {
icaltzutil_set_exact_vtimezones_support (0);
return 0;
}" HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT)
CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
int main(void) {
icalparameter *param;
param = icalproperty_get_first_parameter (NULL, ICAL_FILENAME_PARAMETER);
icalparameter_get_filename (param);
icalparameter_new_filename (NULL);
return 0;
}" HAVE_ICAL_FILENAME_PARAMETER)
CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
int main(void) {
icalproperty *prop;
prop = icalcomponent_get_first_property (NULL, ICAL_COLOR_PROPERTY);
icalproperty_get_color (prop);
icalproperty_set_color (prop, \"white\");
prop = icalproperty_new_color (NULL);
return 0;
}" HAVE_ICAL_COLOR_PROPERTY)
unset(CMAKE_REQUIRED_DEFINITIONS)
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
# ******************************
# gspell
# ******************************
......
......@@ -99,18 +99,6 @@
/* Define if you have libunity */
#cmakedefine HAVE_LIBUNITY 1
/* libical provides ical_set_unknown_token_handling_setting function */
#cmakedefine HAVE_ICAL_UNKNOWN_TOKEN_HANDLING 1
/* libical provides icaltzutil_set_exact_vtimezones_support function */
#cmakedefine HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT 1
/* libical provides ICAL_FILENAME_PARAMETER */
#cmakedefine HAVE_ICAL_FILENAME_PARAMETER 1
/* libical provides ICAL_COLOR_PROPERTY */
#cmakedefine HAVE_ICAL_COLOR_PROPERTY 1
/* When defined GSpell usage is enabled */
#cmakedefine HAVE_GSPELL 1
......
......@@ -35,8 +35,8 @@ set(SOURCES
e-cal-dialogs.c
e-cal-event.c
e-cal-list-view.c
e-cal-model-calendar.c
e-cal-model.c
e-cal-model-calendar.c
e-cal-model-memos.c
e-cal-model-tasks.c
e-cal-ops.c
......@@ -55,11 +55,11 @@ set(SOURCES
e-comp-editor-property-parts.c
e-comp-editor-task.c
e-date-time-list.c
e-day-view.c
e-day-view-layout.c
e-day-view-main-item.c
e-day-view-time-item.c
e-day-view-top-item.c
e-day-view.c
e-meeting-attendee.c
e-meeting-list-view.c
e-meeting-store.c
......@@ -73,11 +73,11 @@ set(SOURCES
e-send-options-utils.c
e-task-table.c
e-to-do-pane.c
e-week-view.c
e-week-view-event-item.c
e-week-view-layout.c
e-week-view-main-item.c
e-week-view-titles-item.c
e-week-view.c
e-weekday-chooser.c
e-timezone-entry.c
itip-utils.c
......
......@@ -113,17 +113,17 @@ calendar_config_get_timezone (void)
return calendar_config_get_timezone_stored ();
}
icaltimezone *
ICalTimezone *
calendar_config_get_icaltimezone (void)
{
gchar *location;
icaltimezone *zone = NULL;
ICalTimezone *zone = NULL;
calendar_config_init ();
location = calendar_config_get_timezone ();
if (location) {
zone = icaltimezone_get_builtin_timezone (location);
zone = i_cal_timezone_get_builtin_timezone (location);
g_free (location);
}
......@@ -228,30 +228,33 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed)
sexp = g_strdup ("(is-completed?)");
} else {
gchar *isodate;
icaltimezone *zone;
struct icaltimetype tt;
ICalTimezone *zone;
ICalTime *tt;
time_t t;
/* Get the current time, and subtract the appropriate
* number of days/hours/minutes. */
zone = calendar_config_get_icaltimezone ();
tt = icaltime_current_time_with_zone (zone);
tt = i_cal_time_current_time_with_zone (zone);
switch (units) {
case E_DURATION_DAYS:
icaltime_adjust (&tt, -value, 0, 0, 0);
i_cal_time_adjust (tt, -value, 0, 0, 0);
break;
case E_DURATION_HOURS:
icaltime_adjust (&tt, 0, -value, 0, 0);
i_cal_time_adjust (tt, 0, -value, 0, 0);
break;
case E_DURATION_MINUTES:
icaltime_adjust (&tt, 0, 0, -value, 0);
i_cal_time_adjust (tt, 0, 0, -value, 0);
break;
default:
g_clear_object (&tt);
g_return_val_if_reached (NULL);
}
t = icaltime_as_timet_with_zone (tt, zone);
t = i_cal_time_as_timet_with_zone (tt, zone);
g_clear_object (&tt);
/* Convert the time to an ISO date string, and build
* the query sub-expression. */
......@@ -399,14 +402,14 @@ calendar_config_get_day_second_zone (void)
void
calendar_config_select_day_second_zone (GtkWidget *parent)
{
icaltimezone *zone = NULL;
ICalTimezone *zone = NULL;
ETimezoneDialog *tzdlg;
GtkWidget *dialog;
gchar *second_location;
second_location = calendar_config_get_day_second_zone ();
if (second_location && *second_location)
zone = icaltimezone_get_builtin_timezone (second_location);
zone = i_cal_timezone_get_builtin_timezone (second_location);
g_free (second_location);
if (!zone)
......@@ -424,10 +427,10 @@ calendar_config_select_day_second_zone (GtkWidget *parent)
const gchar *location = NULL;
zone = e_timezone_dialog_get_timezone (tzdlg);
if (zone == icaltimezone_get_utc_timezone ()) {
if (zone == i_cal_timezone_get_utc_timezone ()) {
location = "UTC";
} else if (zone) {
location = icaltimezone_get_location (zone);
location = i_cal_timezone_get_location (zone);
}
calendar_config_set_day_second_zone (location);
......
......@@ -47,7 +47,7 @@ void calendar_config_remove_notification (CalendarConfigChangedFunc func, gpoint
*/
/* The current timezone, e.g. "Europe/London". */
icaltimezone *calendar_config_get_icaltimezone (void);
ICalTimezone *calendar_config_get_icaltimezone (void);
/* Whether we use 24-hour format or 12-hour format (AM/PM). */
gboolean calendar_config_get_24_hour_format (void);
......
This diff is collapsed.
......@@ -32,24 +32,28 @@
struct _EShell;
void cal_comp_util_add_exdate (ECalComponent *comp, time_t t, icaltimezone *zone);
void cal_comp_util_add_exdate (ECalComponent *comp,
time_t t,
ICalTimezone *zone);
/* Returns TRUE if the component uses the given timezone for both DTSTART
* and DTEND, or if the UTC offsets of the start and end times are the same
* as in the given zone. */
gboolean cal_comp_util_compare_event_timezones (ECalComponent *comp,
ECalClient *client,
icaltimezone *zone);
gboolean cal_comp_util_compare_event_timezones
(ECalComponent *comp,
ECalClient *client,
ICalTimezone *zone);
/* Returns the number of icons owned by the ECalComponent */
gint cal_comp_util_get_n_icons (ECalComponent *comp, GSList **pixbufs);
gint cal_comp_util_get_n_icons (ECalComponent *comp,
GSList **pixbufs);
gboolean cal_comp_is_on_server_sync (ECalComponent *comp,
ECalClient *client,
GCancellable *cancellable,
GError **error);
gboolean cal_comp_is_icalcomp_on_server_sync
(icalcomponent *icalcomp,
(ICalComponent *icomp,
ECalClient *client,
GCancellable *cancellable,
GError **error);
......@@ -79,13 +83,23 @@ ECalComponent * cal_comp_memo_new_with_defaults_sync
GCancellable *cancellable,
GError **error);
void cal_comp_update_time_by_active_window (ECalComponent *comp, struct _EShell *shell);
void cal_comp_update_time_by_active_window
(ECalComponent *comp,
struct _EShell *shell);
void cal_comp_selection_set_string_list (GtkSelectionData *data, GSList *str_list);
GSList *cal_comp_selection_get_string_list (GtkSelectionData *data);
void cal_comp_selection_set_string_list
(GtkSelectionData *data,
GSList *str_list);
GSList * cal_comp_selection_get_string_list
(GtkSelectionData *data);
void cal_comp_set_dtstart_with_oldzone (ECalClient *client, ECalComponent *comp, const ECalComponentDateTime *pdate);
void cal_comp_set_dtend_with_oldzone (ECalClient *client, ECalComponent *comp, const ECalComponentDateTime *pdate);
void cal_comp_set_dtstart_with_oldzone
(ECalClient *client,
ECalComponent *comp,
const ECalComponentDateTime *pdate);
void cal_comp_set_dtend_with_oldzone (ECalClient *client,
ECalComponent *comp,
const ECalComponentDateTime *pdate);
gboolean comp_util_sanitize_recurrence_master_sync
(ECalComponent *comp,
......@@ -93,43 +107,39 @@ gboolean comp_util_sanitize_recurrence_master_sync
GCancellable *cancellable,
GError **error);
gchar *icalcomp_suggest_filename (icalcomponent *icalcomp, const gchar *default_name);
gchar * comp_util_suggest_filename (ICalComponent *icomp,
const gchar *default_name);
void cal_comp_get_instance_times (ECalClient *client,
icalcomponent *icalcomp,
const icaltimezone *default_zone,
time_t *instance_start,
gboolean *start_is_date,
time_t *instance_end,
gboolean *end_is_date,
ICalComponent *icomp,
const ICalTimezone *default_zone,
ICalTime **out_instance_start,
ICalTime **out_instance_end,
GCancellable *cancellable);
time_t cal_comp_gdate_to_timet (const GDate *date,
const icaltimezone *with_zone);
const ICalTimezone *with_zone);
void cal_comp_transfer_item_to (ECalClient *src_client,
void cal_comp_transfer_item_to (ECalClient *src_client,
ECalClient *dest_client,
icalcomponent *icalcomp_vcal,
ICalComponent *icomp_vcal,
gboolean do_copy,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean cal_comp_transfer_item_to_finish (ECalClient *client,
gboolean cal_comp_transfer_item_to_finish(ECalClient *client,
GAsyncResult *result,
GError **error);
gboolean cal_comp_transfer_item_to_sync (ECalClient *src_client,
gboolean cal_comp_transfer_item_to_sync (ECalClient *src_client,
ECalClient *dest_client,
icalcomponent *icalcomp_event,
ICalComponent *icomp_event,
gboolean do_copy,
GCancellable *cancellable,
GError **error);
void cal_comp_util_update_tzid_parameter
(icalproperty *prop,
const struct icaltimetype tt);
(ICalProperty *prop,
const ICalTime *tt);
gint cal_comp_util_compare_time_with_today
(const struct icaltimetype time_tt);
gboolean cal_comp_util_remove_all_properties
(icalcomponent *component,
icalproperty_kind kind);
(const ICalTime *time_tt);
gboolean cal_comp_util_have_in_new_attendees
(const GSList *new_attendees_mails,
const gchar *eml);
......@@ -139,9 +149,9 @@ void cal_comp_util_copy_new_attendees
void cal_comp_util_set_added_attendees_mails
(ECalComponent *comp,
GSList *emails);
const gchar * cal_comp_util_find_parameter_xvalue
(icalproperty *prop,
gchar * cal_comp_util_dup_parameter_xvalue
(ICalProperty *prop,
const gchar *name);
gchar * cal_comp_util_get_attendee_comments
(icalcomponent *icalcomp);
(ICalComponent *icomp);
#endif
......@@ -246,7 +246,7 @@ free_alarm (ECalComponentAlarm *alarm)
static ECalComponentAlarm *
copy_alarm (const ECalComponentAlarm *alarm)
{
return e_cal_component_alarm_clone ((ECalComponentAlarm *) alarm);
return e_cal_component_alarm_copy ((ECalComponentAlarm *) alarm);
}
void
......@@ -355,64 +355,63 @@ e_alarm_list_get_path (GtkTreeModel *tree_model,
/* Builds a string for the duration of the alarm. If the duration is zero, returns NULL. */
static gchar *
get_alarm_duration_string (struct icaldurationtype *duration)
get_alarm_duration_string (ICalDuration *duration)
{
GString *string = g_string_new (NULL);
gchar *ret;
gboolean have_something;
guint value;
have_something = FALSE;
if (duration->days >= 1) {
value = i_cal_duration_get_days (duration);
if (value >= 1) {
/* Translator: Entire string is like "Pop up an alert %d days before start" */
g_string_printf (string, ngettext ("%d day", "%d days", duration->days), duration->days);
g_string_printf (string, ngettext ("%d day", "%d days", value), value);
have_something = TRUE;
}
if (duration->weeks >= 1) {
value = i_cal_duration_get_weeks (duration);
if (value >= 1) {
/* Translator: Entire string is like "Pop up an alert %d weeks before start" */
g_string_printf (string, ngettext ("%d week","%d weeks", duration->weeks), duration->weeks);
g_string_printf (string, ngettext ("%d week","%d weeks", value), value);
have_something = TRUE;
}
if (duration->hours >= 1) {
value = i_cal_duration_get_hours (duration);
if (value >= 1) {
/* Translator: Entire string is like "Pop up an alert %d hours before start" */
g_string_printf (string, ngettext ("%d hour", "%d hours", duration->hours), duration->hours);
g_string_printf (string, ngettext ("%d hour", "%d hours", value), value);
have_something = TRUE;
}
if (duration->minutes >= 1) {
value = i_cal_duration_get_minutes (duration);
if (value >= 1) {
/* Translator: Entire string is like "Pop up an alert %d minutes before start" */
g_string_printf (string, ngettext ("%d minute", "%d minutes", duration->minutes), duration->minutes);
g_string_printf (string, ngettext ("%d minute", "%d minutes", value), value);
have_something = TRUE;
}
if (duration->seconds >= 1) {
value = i_cal_duration_get_seconds (duration);
if (value >= 1) {
/* Translator: Entire string is like "Pop up an alert %d seconds before start" */
g_string_printf (string, ngettext ("%d second", "%d seconds", duration->seconds), duration->seconds);
g_string_printf (string, ngettext ("%d second", "%d seconds", value), value);
have_something = TRUE;
}
if (have_something) {
ret = string->str;
g_string_free (string, FALSE);
return ret;
} else {
g_string_free (string, TRUE);
return NULL;
}
return g_string_free (string, !have_something);
}
static gchar *
get_alarm_string (ECalComponentAlarm *alarm)
{
ECalComponentAlarmAction action;
ECalComponentAlarmTrigger trigger;
ECalComponentAlarmTrigger *trigger;
ICalDuration *duration;
const gchar *base;
gchar *str = NULL, *dur;
e_cal_component_alarm_get_action (alarm, &action);
e_cal_component_alarm_get_trigger (alarm, &trigger);
action = e_cal_component_alarm_get_action (alarm);
trigger = e_cal_component_alarm_get_trigger (alarm);
switch (action) {
case E_CAL_COMPONENT_ALARM_AUDIO:
......@@ -440,12 +439,13 @@ get_alarm_string (ECalComponentAlarm *alarm)
/* FIXME: This does not look like it will localize correctly. */
switch (trigger.type) {
switch (trigger ? e_cal_component_alarm_trigger_get_kind (trigger) : E_CAL_COMPONENT_ALARM_TRIGGER_NONE) {
case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START:
dur = get_alarm_duration_string (&trigger.u.rel_duration);
duration = e_cal_component_alarm_trigger_get_duration (trigger);
dur = get_alarm_duration_string (duration);
if (dur) {
if (trigger.u.rel_duration.is_neg)
if (i_cal_duration_is_neg (duration))
str = g_strdup_printf (
/*Translator: The first %s refers to the base, which would be actions like
* "Play a Sound". Second %s refers to the duration string e.g:"15 minutes"*/
......@@ -467,10 +467,11 @@ get_alarm_string (ECalComponentAlarm *alarm)
break;
case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END:
dur = get_alarm_duration_string (&trigger.u.rel_duration);
duration = e_cal_component_alarm_trigger_get_duration (trigger);
dur = get_alarm_duration_string (duration);
if (dur) {
if (trigger.u.rel_duration.is_neg)
if (i_cal_duration_is_neg (duration))
str = g_strdup_printf (
/* Translator: The first %s refers to the base, which would be actions like
* "Play a Sound". Second %s refers to the duration string e.g:"15 minutes" */
......@@ -492,19 +493,19 @@ get_alarm_string (ECalComponentAlarm *alarm)
break;
case E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE: {
struct icaltimetype itt;
icaltimezone *utc_zone, *current_zone;
ICalTime *itt;
ICalTimezone *utc_zone, *current_zone;
struct tm tm;
gchar buf[256];
/* Absolute triggers come in UTC, so convert them to the local timezone */
itt = trigger.u.abs_time;
itt = e_cal_component_alarm_trigger_get_absolute_time (trigger);
utc_zone = icaltimezone_get_utc_timezone ();
utc_zone = i_cal_timezone_get_utc_timezone ();
current_zone = calendar_config_get_icaltimezone ();
tm = icaltimetype_to_tm_with_zone (&itt, utc_zone, current_zone);
tm = e_cal_util_icaltime_to_tm_with_zone (itt, utc_zone, current_zone);
e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (),
FALSE, FALSE, buf, sizeof (buf));
......
......@@ -49,12 +49,12 @@ struct _ECalComponentPreviewPrivate {
* if it didn't change then the preview is not updated */
gchar *cal_uid;
gchar *comp_uid;
struct icaltimetype comp_last_modified;
ICalTime *comp_last_modified;
gint comp_sequence;
ECalClient *client;
ECalComponent *comp;
icaltimezone *timezone;
ICalTimezone *timezone;
gboolean use_24_hour_format;
};
......@@ -79,25 +79,22 @@ clear_comp_info (ECalComponentPreview *preview)
priv->cal_uid = NULL;
g_free (priv->comp_uid);
priv->comp_uid = NULL;
priv->comp_last_modified = icaltime_null_time ();
priv->comp_sequence = -1;
g_clear_object (&priv->comp_last_modified);
g_clear_object (&priv->client);
g_clear_object (&priv->comp);
if (priv->timezone) {
icaltimezone_free (priv->timezone, 1);
priv->timezone = NULL;
}
g_clear_object (&priv->timezone);
}
/* Stores information about actually shown component and
* returns whether component in the preview changed */
static gboolean
update_comp_info (ECalComponentPreview *preview,
ECalClient *client,
ECalComponent *comp,
icaltimezone *zone,
gboolean use_24_hour_format)
ECalClient *client,
ECalComponent *comp,
ICalTimezone *zone,
gboolean use_24_hour_format)
{
ECalComponentPreviewPrivate *priv;
gboolean changed;
......@@ -115,32 +112,27 @@ update_comp_info (ECalComponentPreview *preview,
const gchar *uid;
gchar *cal_uid;
gchar *comp_uid;
struct icaltimetype comp_last_modified, *itm = NULL;
gint *sequence = NULL;
ICalTime *comp_last_modified;
gint comp_sequence;
source = e_client_get_source (E_CLIENT (client));
cal_uid = g_strdup (e_source_get_uid (source));
e_cal_component_get_uid (comp, &uid);
uid = e_cal_component_get_uid (comp);
comp_uid = g_strdup (uid);
e_cal_component_get_last_modified (comp, &itm);
if (itm) {
comp_last_modified = *itm;
e_cal_component_free_icaltimetype (itm);
} else
comp_last_modified = icaltime_null_time ();
e_cal_component_get_sequence (comp, &sequence);
if (sequence) {
comp_sequence = *sequence;
e_cal_component_free_sequence (sequence);
} else
comp_last_modified = e_cal_component_get_last_modified (comp);
comp_sequence = e_cal_component_get_sequence (comp);
if (comp_sequence < 0)
comp_sequence = 0;
changed = !priv->cal_uid || !priv->comp_uid || !cal_uid || !comp_uid ||
!g_str_equal (priv->cal_uid, cal_uid) ||
!g_str_equal (priv->comp_uid, comp_uid) ||
priv->comp_sequence != comp_sequence ||
icaltime_compare (priv->comp_last_modified, comp_last_modified) != 0;
priv->comp_sequence != comp_sequence;
if (comp_last_modified && priv->comp_last_modified)
changed = changed || i_cal_time_compare (priv->comp_last_modified, comp_last_modified) != 0;
else
changed = changed || comp_last_modified != priv->comp_last_modified;
clear_comp_info (preview);
......@@ -151,7 +143,7 @@ update_comp_info (ECalComponentPreview *preview,
priv->comp = g_object_ref (comp);
priv->client = g_object_ref (client);
priv->timezone = icaltimezone_copy (zone);
priv->timezone = i_cal_timezone_copy (zone);
priv->use_24_hour_format = use_24_hour_format;
}
......@@ -161,26 +153,29 @@ update_comp_info (ECalComponentPreview *preview,
/* Converts a time_t to a string, relative to the specified timezone */
static gchar *
timet_to_str_with_zone (ECalComponentDateTime *dt,
ECalClient *client,
icaltimezone *default_zone)
ECalClient *client,
ICalTimezone *default_zone)
{
struct icaltimetype itt;
icaltimezone *zone = NULL;
ICalTime *itt;
ICalTimezone *zone = NULL;
struct tm tm;
if (dt->tzid != NULL) {
e_cal_client_get_timezone_sync (
client, dt->tzid, &zone, NULL, NULL);
} else if (icaltime_is_utc (*dt->value)) {
zone = icaltimezone_get_utc_timezone ();
if (!dt)
return NULL;
itt = e_cal_component_datetime_get_value (dt);
if (e_cal_component_datetime_get_tzid (dt)) {
e_cal_client_get_timezone_sync (client, e_cal_component_datetime_get_tzid (dt), &zone, NULL, NULL);
} else if (i_cal_time_is_utc (itt)) {
zone = i_cal_timezone_get_utc_timezone ();
}
itt = *dt->value;
if (zone != NULL)
icaltimezone_convert_time (&itt, zone, default_zone);
tm = icaltimetype_to_tm (&itt);
i_cal_timezone_convert_time (itt, zone, default_zone);
tm = e_cal_util_icaltime_to_tm (itt);
return e_datetime_format_format_tm ("calendar", "table", itt.is_date ? DTFormatKindDate : DTFormatKindDateTime, &tm);
return e_datetime_format_format_tm ("calendar", "table", i_cal_time_is_date (itt) ? DTFormatKindDate : DTFormatKindDateTime, &tm);
}
static void
......@@ -213,17 +208,18 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
{
ECalClient *client;
ECalComponent *comp;
icaltimezone *default_zone;
ECalComponentText text;
ECalComponentDateTime dt;
ICalTimezone *default_zone;
ECalComponentText *text;
ECalComponentDateTime *dt;
gchar *str;
GString *string;
GSList *list, *iter;
icalcomponent *icalcomp;
icalproperty *icalprop;
icalproperty_status status;
const gchar *location, *url, *tmp;
gint *priority_value;
ICalComponent *icomp;
ICalProperty *prop;
ICalPropertyStatus status;
const gchar *tmp;
gchar *location, *url;
gint priority;
gchar *markup;
client = preview->priv->client;
......@@ -231,23 +227,24 @@ cal_component_preview_write_html (ECalComponentPreview *preview,
default_zone = preview->priv->timezone;
/* write document header */
e_cal_component_get_summary (comp, &text);
text = e_cal_component_get_summary (comp);
g_string_append (buffer, HTML_HEADER);
g_string_append (buffer, "<body class=\"-e-web-view-background-color -e-web-view-text-color\">");
markup = g_markup_escape_text (text.value ? text.value : _("Untitled"), -1);