Commit 5d3a5e06 authored by Milan Crha's avatar Milan Crha

Adapt to the recent libical-glib and eds API changes

This is for bare structure wrappers rename and addition of some _inplace()
helper functions.
parent 530270d8
......@@ -229,7 +229,7 @@ calendar_config_get_hide_completed_tasks_sexp (gboolean get_completed)
} else {
gchar *isodate;
ICalTimezone *zone;
ICalTimetype *tt;
ICalTime *tt;
time_t t;
/* Get the current time, and subtract the appropriate
......
......@@ -318,7 +318,7 @@ cal_comp_event_new_with_defaults_sync (ECalClient *client,
ECalComponent *comp;
ECalComponentAlarm *alarm;
ICalProperty *prop;
ICalDurationType *duration;
ICalDuration *duration;
ECalComponentAlarmTrigger *trigger;
if (client && !e_cal_client_get_default_object_sync (client, &icomp, cancellable, error))
......@@ -349,20 +349,20 @@ cal_comp_event_new_with_defaults_sync (ECalClient *client,
e_cal_component_alarm_set_action (alarm, E_CAL_COMPONENT_ALARM_DISPLAY);
duration = i_cal_duration_type_null_duration ();
i_cal_duration_type_set_is_neg (duration, TRUE);
duration = i_cal_duration_null_duration ();
i_cal_duration_set_is_neg (duration, TRUE);
switch (default_reminder_units) {
case E_DURATION_MINUTES:
i_cal_duration_type_set_minutes (duration, default_reminder_interval);
i_cal_duration_set_minutes (duration, default_reminder_interval);
break;
case E_DURATION_HOURS:
i_cal_duration_type_set_hours (duration, default_reminder_interval);
i_cal_duration_set_hours (duration, default_reminder_interval);
break;
case E_DURATION_DAYS:
i_cal_duration_type_set_days (duration, default_reminder_interval);
i_cal_duration_set_days (duration, default_reminder_interval);
break;
default:
......@@ -390,7 +390,7 @@ cal_comp_event_new_with_current_time_sync (ECalClient *client,
GError **error)
{
ECalComponent *comp;
ICalTimetype *itt;
ICalTime *itt;
ECalComponentDateTime *dt;
ICalTimezone *zone;
......@@ -412,7 +412,7 @@ cal_comp_event_new_with_current_time_sync (ECalClient *client,
e_cal_component_set_dtend (comp, dt);
} else {
itt = i_cal_time_current_time_with_zone (zone);
i_cal_time_adjust (itt, 0, 1, -i_cal_timetype_get_minute (itt), -i_cal_timetype_get_second (itt));
i_cal_time_adjust (itt, 0, 1, -i_cal_time_get_minute (itt), -i_cal_time_get_second (itt));
dt = e_cal_component_datetime_new_take (itt, zone ? g_strdup (i_cal_timezone_get_tzid (zone)) : NULL);
......@@ -497,7 +497,7 @@ cal_comp_update_time_by_active_window (ECalComponent *comp,
ECalendarView *cal_view;
time_t start = 0, end = 0;
ICalTimezone *zone;
ICalTimetype *itt;
ICalTime *itt;
ICalComponent *icomp;
ICalProperty *prop;
......@@ -798,11 +798,11 @@ comp_util_sanitize_recurrence_master_sync (ECalComponent *comp,
return FALSE;
}
i_cal_timetype_get_date (e_cal_component_datetime_get_value (msdt), &yy, &mm, &dd);
i_cal_timetype_set_date (e_cal_component_datetime_get_value (sdt), yy, mm, dd);
i_cal_time_get_date (e_cal_component_datetime_get_value (msdt), &yy, &mm, &dd);
i_cal_time_set_date (e_cal_component_datetime_get_value (sdt), yy, mm, dd);
i_cal_timetype_get_date (e_cal_component_datetime_get_value (medt), &yy, &mm, &dd);
i_cal_timetype_set_date (e_cal_component_datetime_get_value (edt), yy, mm, dd);
i_cal_time_get_date (e_cal_component_datetime_get_value (medt), &yy, &mm, &dd);
i_cal_time_set_date (e_cal_component_datetime_get_value (edt), yy, mm, dd);
e_cal_component_set_dtstart (comp, sdt);
e_cal_component_set_dtend (comp, edt);
......@@ -853,11 +853,11 @@ void
cal_comp_get_instance_times (ECalClient *client,
ICalComponent *icomp,
const ICalTimezone *default_zone,
ICalTimetype **out_instance_start,
ICalTimetype **out_instance_end,
ICalTime **out_instance_start,
ICalTime **out_instance_end,
GCancellable *cancellable)
{
ICalTimetype *start_time, *end_time;
ICalTime *start_time, *end_time;
const ICalTimezone *zone = default_zone;
g_return_if_fail (E_IS_CAL_CLIENT (client));
......@@ -872,11 +872,11 @@ cal_comp_get_instance_times (ECalClient *client,
if (!end_time || i_cal_time_is_null_time (end_time)) {
g_clear_object (&end_time);
end_time = i_cal_timetype_new_clone (start_time);
end_time = i_cal_time_new_clone (start_time);
}
if (i_cal_timetype_get_zone (start_time)) {
zone = i_cal_timetype_get_zone (start_time);
if (i_cal_time_get_timezone (start_time)) {
zone = i_cal_time_get_timezone (start_time);
} else {
ICalParameter *param = NULL;
ICalProperty *prop = i_cal_component_get_first_property (icomp, I_CAL_DTSTART_PROPERTY);
......@@ -902,11 +902,11 @@ cal_comp_get_instance_times (ECalClient *client,
}
}
*out_instance_start = i_cal_timetype_new_clone (start_time);
i_cal_timetype_set_zone (*out_instance_start, zone);
*out_instance_start = i_cal_time_new_clone (start_time);
i_cal_time_set_timezone (*out_instance_start, zone);
if (i_cal_timetype_get_zone (end_time)) {
zone = i_cal_timetype_get_zone (end_time);
if (i_cal_time_get_timezone (end_time)) {
zone = i_cal_time_get_timezone (end_time);
} else {
ICalParameter *param = NULL;
ICalProperty *prop = i_cal_component_get_first_property (icomp, I_CAL_DTEND_PROPERTY);
......@@ -935,8 +935,8 @@ cal_comp_get_instance_times (ECalClient *client,
}
}
*out_instance_end = i_cal_timetype_new_clone (end_time);
i_cal_timetype_set_zone (*out_instance_end, zone);
*out_instance_end = i_cal_time_new_clone (end_time);
i_cal_time_set_timezone (*out_instance_end, zone);
g_clear_object (&start_time);
g_clear_object (&end_time);
......@@ -947,7 +947,7 @@ cal_comp_gdate_to_timet (const GDate *date,
const ICalTimezone *with_zone)
{
struct tm tm;
ICalTimetype *tt;
ICalTime *tt;
time_t res;
g_return_val_if_fail (date != NULL, (time_t) -1);
......@@ -955,7 +955,7 @@ cal_comp_gdate_to_timet (const GDate *date,
g_date_to_struct_tm (date, &tm);
tt = tm_to_icaltimetype (&tm, TRUE);
tt = e_cal_util_tm_to_i_cal_time (&tm, TRUE);
if (with_zone)
res = i_cal_time_as_timet_with_zone (tt, (ICalTimezone *) with_zone);
else
......@@ -1343,24 +1343,24 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
void
cal_comp_util_update_tzid_parameter (ICalProperty *prop,
const ICalTimetype *tt)
const ICalTime *tt)
{
ICalParameter *param;
const gchar *tzid = NULL;
g_return_if_fail (prop != NULL);
if (!tt || !i_cal_time_is_valid_time ((ICalTimetype *) tt) ||
i_cal_time_is_null_time ((ICalTimetype *) tt))
if (!tt || !i_cal_time_is_valid_time ((ICalTime *) tt) ||
i_cal_time_is_null_time ((ICalTime *) tt))
return;
param = i_cal_property_get_first_parameter (prop, I_CAL_TZID_PARAMETER);
if (i_cal_timetype_get_zone ((ICalTimetype *) tt))
tzid = i_cal_timezone_get_tzid (i_cal_timetype_get_zone ((ICalTimetype *) tt));
if (i_cal_time_get_timezone ((ICalTime *) tt))
tzid = i_cal_timezone_get_tzid (i_cal_time_get_timezone ((ICalTime *) tt));
if (i_cal_timetype_get_zone ((ICalTimetype *) tt) && tzid && *tzid &&
!i_cal_time_is_utc ((ICalTimetype *) tt) &&
!i_cal_time_is_date ((ICalTimetype *) tt)) {
if (i_cal_time_get_timezone ((ICalTime *) tt) && tzid && *tzid &&
!i_cal_time_is_utc ((ICalTime *) tt) &&
!i_cal_time_is_date ((ICalTime *) tt)) {
if (param) {
i_cal_parameter_set_tzid (param, (gchar *) tzid);
g_object_unref (param);
......@@ -1376,9 +1376,9 @@ cal_comp_util_update_tzid_parameter (ICalProperty *prop,
/* Returns <0 for time before today, 0 for today, >0 for after today (future) */
gint
cal_comp_util_compare_time_with_today (const ICalTimetype *time_tt)
cal_comp_util_compare_time_with_today (const ICalTime *time_tt)
{
ICalTimetype *now_tt, *tt = (ICalTimetype *) time_tt;
ICalTime *now_tt, *tt = (ICalTime *) time_tt;
gint res;
if (!tt || i_cal_time_is_null_time (tt))
......@@ -1388,8 +1388,8 @@ cal_comp_util_compare_time_with_today (const ICalTimetype *time_tt)
now_tt = i_cal_time_today ();
res = i_cal_time_compare_date_only (tt, now_tt);
} else {
now_tt = i_cal_time_current_time_with_zone (i_cal_timetype_get_zone (tt));
i_cal_timetype_set_zone (now_tt, i_cal_timetype_get_zone (tt));
now_tt = i_cal_time_current_time_with_zone (i_cal_time_get_timezone (tt));
i_cal_time_set_timezone (now_tt, i_cal_time_get_timezone (tt));
res = i_cal_time_compare (tt, now_tt);
}
......
......@@ -113,8 +113,8 @@ gchar * comp_util_suggest_filename (ICalComponent *icomp,
void cal_comp_get_instance_times (ECalClient *client,
ICalComponent *icomp,
const ICalTimezone *default_zone,
ICalTimetype **out_instance_start,
ICalTimetype **out_instance_end,
ICalTime **out_instance_start,
ICalTime **out_instance_end,
GCancellable *cancellable);
time_t cal_comp_gdate_to_timet (const GDate *date,
const ICalTimezone *with_zone);
......@@ -137,9 +137,9 @@ gboolean cal_comp_transfer_item_to_sync (ECalClient *src_client,
GError **error);
void cal_comp_util_update_tzid_parameter
(ICalProperty *prop,
const ICalTimetype *tt);
const ICalTime *tt);
gint cal_comp_util_compare_time_with_today
(const ICalTimetype *time_tt);
(const ICalTime *time_tt);
gboolean cal_comp_util_have_in_new_attendees
(const GSList *new_attendees_mails,
const gchar *eml);
......
......@@ -355,7 +355,7 @@ 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 (ICalDurationType *duration)
get_alarm_duration_string (ICalDuration *duration)
{
GString *string = g_string_new (NULL);
gboolean have_something;
......@@ -363,35 +363,35 @@ get_alarm_duration_string (ICalDurationType *duration)
have_something = FALSE;
value = i_cal_duration_type_get_days (duration);
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", value), value);
have_something = TRUE;
}
value = i_cal_duration_type_get_weeks (duration);
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", value), value);
have_something = TRUE;
}
value = i_cal_duration_type_get_hours (duration);
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", value), value);
have_something = TRUE;
}
value = i_cal_duration_type_get_minutes (duration);
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", value), value);
have_something = TRUE;
}
value = i_cal_duration_type_get_seconds (duration);
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", value), value);
......@@ -406,7 +406,7 @@ get_alarm_string (ECalComponentAlarm *alarm)
{
ECalComponentAlarmAction action;
ECalComponentAlarmTrigger *trigger;
ICalDurationType *duration;
ICalDuration *duration;
const gchar *base;
gchar *str = NULL, *dur;
......@@ -445,7 +445,7 @@ get_alarm_string (ECalComponentAlarm *alarm)
dur = get_alarm_duration_string (duration);
if (dur) {
if (i_cal_duration_type_is_neg (duration))
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"*/
......@@ -471,7 +471,7 @@ get_alarm_string (ECalComponentAlarm *alarm)
dur = get_alarm_duration_string (duration);
if (dur) {
if (i_cal_duration_type_is_neg (duration))
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" */
......@@ -493,7 +493,7 @@ get_alarm_string (ECalComponentAlarm *alarm)
break;
case E_CAL_COMPONENT_ALARM_TRIGGER_ABSOLUTE: {
ICalTimetype *itt;
ICalTime *itt;
ICalTimezone *utc_zone, *current_zone;
struct tm tm;
gchar buf[256];
......@@ -505,7 +505,7 @@ get_alarm_string (ECalComponentAlarm *alarm)
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_i_cal_time_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));
......
......@@ -48,7 +48,7 @@ struct _ECalComponentPreviewPrivate {
* if it didn't change then the preview is not updated */
gchar *cal_uid;
gchar *comp_uid;
ICalTimetype *comp_last_modified;
ICalTime *comp_last_modified;
gint comp_sequence;
ECalClient *client;
......@@ -111,7 +111,7 @@ update_comp_info (ECalComponentPreview *preview,
const gchar *uid;
gchar *cal_uid;
gchar *comp_uid;
ICalTimetype *comp_last_modified;
ICalTime *comp_last_modified;
gint comp_sequence;
source = e_client_get_source (E_CLIENT (client));
......@@ -155,7 +155,7 @@ timet_to_str_with_zone (ECalComponentDateTime *dt,
ECalClient *client,
ICalTimezone *default_zone)
{
ICalTimetype *itt;
ICalTime *itt;
ICalTimezone *zone = NULL;
struct tm tm;
......@@ -172,7 +172,7 @@ timet_to_str_with_zone (ECalComponentDateTime *dt,
if (zone != NULL)
i_cal_timezone_convert_time (itt, zone, default_zone);
tm = icaltimetype_to_tm (itt);
tm = e_cal_util_i_cal_time_to_tm (itt);
return e_datetime_format_format_tm ("calendar", "table", i_cal_time_is_date (itt) ? DTFormatKindDate : DTFormatKindDateTime, &tm);
}
......
......@@ -139,7 +139,7 @@ component_data_equal (ComponentData *comp_data1,
ComponentData *comp_data2)
{
ICalComponent *icomp1, *icomp2;
ICalTimetype *tt1, *tt2;
ICalTime *tt1, *tt2;
gchar *as_str1, *as_str2;
gboolean equal;
......@@ -1093,8 +1093,8 @@ typedef struct
static gboolean
cal_data_model_instance_generated (ICalComponent *icomp,
ICalTimetype *instance_start,
ICalTimetype *instance_end,
ICalTime *instance_start,
ICalTime *instance_end,
gpointer user_data,
GCancellable *cancellable,
GError **error)
......@@ -1102,7 +1102,7 @@ cal_data_model_instance_generated (ICalComponent *icomp,
GenerateInstancesData *gid = user_data;
ComponentData *comp_data;
ECalComponent *comp_copy;
ICalTimetype *tt, *tt2;
ICalTime *tt, *tt2;
time_t start_tt, end_tt;
g_return_val_if_fail (gid != NULL, FALSE);
......@@ -1310,7 +1310,7 @@ cal_data_model_process_modified_or_added_objects (ECalClientView *view,
/* Single or detached instance, the simple case */
ECalComponent *comp;
ComponentData *comp_data;
ICalTimetype *start_tt = NULL, *end_tt = NULL;
ICalTime *start_tt = NULL, *end_tt = NULL;
time_t instance_start, instance_end;
if (data_model->priv->skip_cancelled &&
......
......@@ -631,14 +631,14 @@ ecal_event (ECalendarItem *calitem,
{
GoToDialog *dlg = user_data;
GDate start_date, end_date;
ICalTimetype *tt = i_cal_time_null_time ();
ICalTime *tt = i_cal_time_null_time ();
ICalTimezone *timezone;
time_t et;
g_warn_if_fail (e_calendar_item_get_selection (calitem, &start_date, &end_date));
timezone = e_cal_data_model_get_timezone (dlg->data_model);
i_cal_timetype_set_date (tt,
i_cal_time_set_date (tt,
g_date_get_year (&start_date),
g_date_get_month (&start_date),
g_date_get_day (&start_date));
......@@ -659,7 +659,7 @@ get_current_time (ECalendarItem *calitem,
gpointer data)
{
ICalTimezone *zone;
ICalTimetype *tt;
ICalTime *tt;
struct tm tmp_tm = { 0 };
/* Get the current timezone. */
......@@ -667,7 +667,7 @@ get_current_time (ECalendarItem *calitem,
tt = i_cal_time_from_timet_with_zone (time (NULL), FALSE, zone);
tmp_tm = icaltimetype_to_tm (tt);
tmp_tm = e_cal_util_i_cal_time_to_tm (tt);
g_clear_object (&tt);
......@@ -785,15 +785,15 @@ e_cal_dialogs_goto_run (GtkWindow *parent,
dlg->month_val = g_date_get_month (from_date) - 1;
dlg->day_val = g_date_get_day (from_date);
} else {
ICalTimetype *tt;
ICalTime *tt;
ICalTimezone *timezone;
timezone = e_cal_data_model_get_timezone (dlg->data_model);
tt = i_cal_time_current_time_with_zone (timezone);
dlg->year_val = i_cal_timetype_get_year (tt);
dlg->month_val = i_cal_timetype_get_month (tt) - 1;
dlg->day_val = i_cal_timetype_get_day (tt);
dlg->year_val = i_cal_time_get_year (tt);
dlg->month_val = i_cal_time_get_month (tt) - 1;
dlg->day_val = i_cal_time_get_day (tt);
g_clear_object (&tt);
}
......
......@@ -135,13 +135,13 @@ get_current_time_cb (ECellDateEdit *ecde,
{
ECalListView *cal_list_view = data;
ICalTimezone *zone;
ICalTimetype *tt;
ICalTime *tt;
struct tm tmp_tm;
zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (cal_list_view));
tt = i_cal_time_from_timet_with_zone (time (NULL), FALSE, zone);
tmp_tm = icaltimetype_to_tm (tt);
tmp_tm = e_cal_util_i_cal_time_to_tm (tt);
g_clear_object (&tt);
......@@ -579,7 +579,7 @@ e_cal_list_view_get_selected_events (ECalendarView *cal_view)
/* It also frees 'itt' */
static void
adjust_range (ICalTimetype *itt,
adjust_range (ICalTime *itt,
time_t *earliest,
time_t *latest,
gboolean *set)
......
......@@ -49,7 +49,7 @@ static ECellDateEditValue *
get_dtend (ECalModelCalendar *model,
ECalModelComponent *comp_data)
{
ICalTimetype *tt_end;
ICalTime *tt_end;
if (!comp_data->dtend) {
ICalProperty *prop;
......@@ -86,7 +86,7 @@ get_dtend (ECalModelCalendar *model,
if (i_cal_time_is_date (tt_end) &&
(prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_DTSTART_PROPERTY)) != NULL) {
ICalTimetype *tt_start;
ICalTime *tt_start;
ICalTimezone *start_zone = NULL;
gboolean got_start_zone = FALSE;
......
......@@ -64,20 +64,21 @@ cal_model_memos_fill_component_from_values (ECalModel *model,
ECalModelComponent *comp_data,
GHashTable *values)
{
ICalTimetype *dtstart;
ICalTime *dtstart;
g_return_if_fail (E_IS_CAL_MODEL_MEMOS (model));
g_return_if_fail (comp_data != NULL);
g_return_if_fail (values != NULL);
dtstart = i_cal_component_get_dtstart (comp_data->icalcomp);
if (i_cal_time_is_null_time (dtstart) || !i_cal_time_is_valid_time (dtstart)) {
if (!dtstart || i_cal_time_is_null_time (dtstart) || !i_cal_time_is_valid_time (dtstart)) {
g_clear_object (&dtstart);
dtstart = i_cal_time_today ();
i_cal_component_set_dtstart (comp_data->icalcomp, dtstart);
g_clear_object (&dtstart);
}
g_clear_object (&dtstart);
}
static gint
......
......@@ -135,7 +135,7 @@ static ECellDateEditValue *
get_completed (ECalModelComponent *comp_data)
{
if (!comp_data->completed) {
ICalTimetype *tt_completed;
ICalTime *tt_completed;
ICalTimezone *zone = NULL;
ICalProperty *prop;
......@@ -165,7 +165,7 @@ static ECellDateEditValue *
get_due (ECalModelComponent *comp_data)
{
if (!comp_data->due) {
ICalTimetype *tt_due;
ICalTime *tt_due;
ICalTimezone *zone = NULL;
ICalProperty *prop;
......@@ -196,7 +196,7 @@ static gpointer
get_geo (ECalModelComponent *comp_data)
{
ICalProperty *prop;
ICalGeoType *geo = NULL;
ICalGeo *geo = NULL;
static gchar buf[32];
prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_GEO_PROPERTY);
......@@ -205,10 +205,10 @@ get_geo (ECalModelComponent *comp_data)
if (geo) {
g_snprintf (
buf, sizeof (buf), "%g %s, %g %s",
fabs (i_cal_geo_type_get_lat (geo)),
i_cal_geo_type_get_lat (geo) >= 0.0 ? "N" : "S",
fabs (i_cal_geo_type_get_lon (geo)),
i_cal_geo_type_get_lon (geo) >= 0.0 ? "E" : "W");
fabs (i_cal_geo_get_lat (geo)),
i_cal_geo_get_lat (geo) >= 0.0 ? "N" : "S",
fabs (i_cal_geo_get_lon (geo)),
i_cal_geo_get_lon (geo) >= 0.0 ? "E" : "W");
g_object_unref (prop);
g_object_unref (geo);
return buf;
......@@ -378,7 +378,7 @@ get_due_status (ECalModelTasks *model,
if (!prop)
return E_CAL_MODEL_TASKS_DUE_NEVER;
else {
ICalTimetype *now_tt, *due_tt;
ICalTime *now_tt, *due_tt;
ICalTimezone *zone = NULL;
/* Second, is it already completed? */
......@@ -473,14 +473,14 @@ set_completed (ECalModelTasks *model,
if (!dv)
ensure_task_not_complete (comp_data, TRUE);
else {
ICalTimetype *tt;
ICalTime *tt;
time_t t;
tt = e_cell_date_edit_value_get_time (dv);
if (i_cal_time_is_date (tt)) {
/* if it's a date, it will be floating,
* but completed needs a date time value */
i_cal_timetype_set_is_date (tt, FALSE);
i_cal_time_set_is_date (tt, FALSE);
t = i_cal_time_as_timet_with_zone (tt, e_cal_model_get_timezone (E_CAL_MODEL (model)));
} else {
/* we assume that COMPLETED is entered in the current timezone,
......@@ -533,7 +533,7 @@ set_geo (ECalModelComponent *comp_data,
{
gdouble latitude = 0.0, longitude = 0.0;
gint matched;
ICalGeoType *geo;
ICalGeo *geo;
ICalProperty *prop;
prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_GEO_PROPERTY);
......@@ -548,7 +548,7 @@ set_geo (ECalModelComponent *comp_data,
if (matched != 2)
show_geo_warning ();
geo = i_cal_geo_type_new (latitude, longitude);
geo = i_cal_geo_new (latitude, longitude);
if (prop) {
i_cal_property_set_geo (prop, geo);
......
......@@ -339,7 +339,7 @@ get_dtstart (ECalModel *model,
ECalModelComponent *comp_data)
{
ECalModelPrivate *priv;
ICalTimetype *tt_start;
ICalTime *tt_start;
priv = model->priv;
......@@ -387,14 +387,14 @@ static ECellDateEditValue *
get_datetime_from_utc (ECalModel *model,
ECalModelComponent *comp_data,
ICalPropertyKind propkind,
ICalTimetype * (*get_value) (ICalProperty *prop),
ICalTime * (*get_value) (ICalProperty *prop),
ECellDateEditValue **buffer)
{
g_return_val_if_fail (buffer != NULL, NULL);
if (!*buffer) {
ECalModelPrivate *priv;
ICalTimetype *tt_value;
ICalTime *tt_value;
ICalProperty *prop;
priv = model->priv;
......@@ -567,7 +567,7 @@ set_summary (ECalModelComponent *comp_data,
static void
datetime_to_zone (ECalClient *client,
ICalTimetype *tt,
ICalTime *tt,
ICalTimezone *tt_zone,
const gchar *tzid)
{
......@@ -1440,7 +1440,7 @@ cal_model_create_component_from_values_thread (EAlertSinkThreadJobData *job_data
if (tt > 0) {
/* Store Memo DTSTART as date, not as date-time */
ICalTimetype *itt = i_cal_time_from_timet_with_zone (tt,
ICalTime *itt = i_cal_time_from_timet_with_zone (tt,
i_cal_component_isa (comp_data->icalcomp) == I_CAL_VJOURNAL_COMPONENT, e_cal_model_get_timezone (ccd->model));
prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_DTSTART_PROPERTY);
......@@ -2624,14 +2624,14 @@ e_cal_model_update_comp_time (ECalModel *model,
gconstpointer time_value,
ICalPropertyKind kind,
void (*set_func) (ICalProperty *prop,
ICalTimetype *v),
ICalProperty * (*new_func) (ICalTimetype *v))
ICalTime *v),
ICalProperty * (*new_func) (ICalTime *v))
{
ECellDateEditValue *dv = (ECellDateEditValue *) time_value;
ICalProperty *prop;
ICalParameter *param;
ICalTimezone *model_zone;
ICalTimetype *tt;
ICalTime *tt;
g_return_if_fail (model != NULL);
g_return_if_fail (comp_data != NULL);
......@@ -3991,7 +3991,7 @@ e_cal_model_date_value_to_string (ECalModel *model,
return g_strdup ("");
/* We currently convert all the dates to the current timezone. */
tmp_tm = icaltimetype_to_tm_with_zone (e_cell_date_edit_value_get_time (dv), e_cell_date_edit_value_get_zone (dv), priv->zone);
tmp_tm = e_cal_util_i_cal_time_to_tm_with_zone (e_cell_date_edit_value_get_time (dv), e_cell_date_edit_value_get_zone (dv), priv->zone);
memset (buffer, 0, sizeof (buffer));
e_time_format_date_and_time (&tmp_tm, priv->use_24_hour_format,
......@@ -4009,14 +4009,14 @@ typedef struct _GenerateInstacesData {
static gboolean
ecm_generate_instances_cb (ICalComponent *comp,
ICalTimetype *instance_start,
ICalTimetype *instance_end,
ICalTime *instance_start,
ICalTime *instance_end,
gpointer user_data,
GCancellable *cancellable,
GError **error)
{
GenerateInstancesData *gid = user_data;
ICalTimetype *changed_instance_start = NULL, *changed_instance_end = NULL;
ICalTime *changed_instance_start = NULL, *changed_instance_end = NULL;
gboolean res;
g_return_val_if_fail (gid != NULL, FALSE);
......@@ -4084,10 +4084,10 @@ void
e_cal_model_set_instance_times (ECalModelComponent *comp_data,
const ICalTimezone *zone)
{
ICalTimetype *instance_start = NULL, *instance_end = NULL;
ICalTime *instance_start = NULL, *instance_end = NULL;
if (i_cal_component_isa (comp_data->icalcomp) == I_CAL_VEVENT_COMPONENT) {
ICalTimetype *start_time, *end_time;
ICalTime *start_time, *end_time;
start_time = i_cal_component_get_dtstart (comp_data->icalcomp);
end_time = i_cal_component_get_dtend (comp_data->icalcomp);
......@@ -4097,7 +4097,7 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data,
* just make start_time = end_time so that end_time
* will be a valid date
*/
end_time = i_cal_timetype_new_clone (start_time);
end_time = i_cal_time_new_clone (start_time);
i_cal_time_adjust (end_time, 1, 0, 0, 0);