[evolution-data-server] Replace deprecated icaltime_from_timet() with icaltime_from_timet_with_zone()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Replace deprecated icaltime_from_timet() with icaltime_from_timet_with_zone()
- Date: Thu, 5 Jan 2017 14:39:11 +0000 (UTC)
commit a1e8e1465edc02ba216fd64681d17311d7825c20
Author: Milan Crha <mcrha redhat com>
Date: Thu Jan 5 15:38:44 2017 +0100
Replace deprecated icaltime_from_timet() with icaltime_from_timet_with_zone()
The upcoming libical release can have the deprecated symbol removed
and the replacement is available in the requested minimum version
of the libical already, thus no dependency change by replacing it.
.../backends/gtasks/e-cal-backend-gtasks.c | 4 ++--
src/calendar/libecal/e-cal-client.c | 6 ++----
src/calendar/libecal/e-cal-recur.c | 5 +----
src/calendar/libecal/e-cal-util.c | 6 +-----
src/camel/providers/imapx/camel-imapx-server.c | 4 ++--
.../libecal/client/test-cal-client-bulk-methods.c | 2 +-
.../libecal/client/test-cal-client-create-object.c | 4 ++--
.../client/test-cal-client-get-attachment-uris.c | 2 +-
.../client/test-cal-client-get-object-list.c | 2 +-
.../libecal/client/test-cal-client-get-revision.c | 2 +-
tests/libecal/client/test-cal-client-get-view.c | 2 +-
.../libecal/client/test-cal-client-modify-object.c | 2 +-
.../client/test-cal-client-receive-objects.c | 2 +-
tests/libecal/client/test-cal-client-refresh.c | 2 +-
.../libecal/client/test-cal-client-remove-object.c | 2 +-
.../libecal/client/test-cal-client-revision-view.c | 2 +-
.../libecal/client/test-cal-client-send-objects.c | 2 +-
tests/libedata-cal/test-intervaltree.c | 8 ++++----
18 files changed, 25 insertions(+), 34 deletions(-)
---
diff --git a/src/calendar/backends/gtasks/e-cal-backend-gtasks.c
b/src/calendar/backends/gtasks/e-cal-backend-gtasks.c
index 8adc520..8c3aade 100644
--- a/src/calendar/backends/gtasks/e-cal-backend-gtasks.c
+++ b/src/calendar/backends/gtasks/e-cal-backend-gtasks.c
@@ -282,13 +282,13 @@ ecb_gtasks_gdata_to_comp (GDataTasksTask *task)
tt);
if (gdata_tasks_task_get_due (task) > 0) {
- tt = icaltime_from_timet (gdata_tasks_task_get_due (task), 1);
+ tt = icaltime_from_timet_with_zone (gdata_tasks_task_get_due (task), 1, NULL);
if (icaltime_is_valid_time (tt) && !icaltime_is_null_time (tt))
icalcomponent_set_due (icomp, tt);
}
if (gdata_tasks_task_get_completed (task) > 0) {
- tt = icaltime_from_timet (gdata_tasks_task_get_completed (task), 1);
+ tt = icaltime_from_timet_with_zone (gdata_tasks_task_get_completed (task), 1, NULL);
if (icaltime_is_valid_time (tt) && !icaltime_is_null_time (tt))
ecb_gtasks_update_ical_time_property (icomp, ICAL_COMPLETED_PROPERTY,
icalproperty_new_completed,
diff --git a/src/calendar/libecal/e-cal-client.c b/src/calendar/libecal/e-cal-client.c
index 580e194..5335f10 100644
--- a/src/calendar/libecal/e-cal-client.c
+++ b/src/calendar/libecal/e-cal-client.c
@@ -2381,8 +2381,7 @@ add_instance (ECalComponent *comp,
/* Floating date, set in the default zone */
itt = icaltime_from_timet_with_zone (start, TRUE, instances_hold->default_zone);
} else {
- itt = icaltime_from_timet (
- start, dtstart.value && dtstart.value->is_date);
+ itt = icaltime_from_timet_with_zone (start, dtstart.value && dtstart.value->is_date,
NULL);
if (dtstart.tzid) {
g_free ((gchar *) dtstart.tzid);
dtstart.tzid = NULL;
@@ -2420,8 +2419,7 @@ add_instance (ECalComponent *comp,
/* Floating date, set in the default zone */
itt = icaltime_from_timet_with_zone (end, TRUE, instances_hold->default_zone);
} else {
- itt = icaltime_from_timet (
- end, dtend.value && dtend.value->is_date);
+ itt = icaltime_from_timet_with_zone (end, dtend.value && dtend.value->is_date, NULL);
if (dtend.tzid) {
g_free ((gchar *) dtend.tzid);
dtend.tzid = NULL;
diff --git a/src/calendar/libecal/e-cal-recur.c b/src/calendar/libecal/e-cal-recur.c
index d497293..535d56c 100644
--- a/src/calendar/libecal/e-cal-recur.c
+++ b/src/calendar/libecal/e-cal-recur.c
@@ -4484,10 +4484,7 @@ cal_object_time_from_time (CalObjTime *cotime,
{
struct icaltimetype tt;
- if (zone)
- tt = icaltime_from_timet_with_zone (t, FALSE, zone);
- else
- tt = icaltime_from_timet (t, FALSE);
+ tt = icaltime_from_timet_with_zone (t, FALSE, zone);
cotime->year = tt.year;
cotime->month = tt.month - 1;
diff --git a/src/calendar/libecal/e-cal-util.c b/src/calendar/libecal/e-cal-util.c
index 3486b4a..bd10022 100644
--- a/src/calendar/libecal/e-cal-util.c
+++ b/src/calendar/libecal/e-cal-util.c
@@ -1391,11 +1391,7 @@ check_first_instance_cb (ECalComponent *comp,
struct icaltimetype dtstart;
dtstart = icalcomponent_get_dtstart (icalcomp);
- if (dtstart.zone) {
- rid = icaltime_from_timet_with_zone (instance_start, dtstart.is_date, dtstart.zone);
- } else {
- rid = icaltime_from_timet (instance_start, dtstart.is_date);
- }
+ rid = icaltime_from_timet_with_zone (instance_start, dtstart.is_date, dtstart.zone);
}
ifs->matches = icaltime_compare (ifs->rid, rid) == 0;
diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c
index 24fd413..e7ad028 100644
--- a/src/camel/providers/imapx/camel-imapx-server.c
+++ b/src/camel/providers/imapx/camel-imapx-server.c
@@ -4595,7 +4595,7 @@ camel_imapx_server_append_message_sync (CamelIMAPXServer *is,
camel_name_value_array_copy (camel_message_info_get_user_tags (mi)));
if (date_time > 0) {
- icaltime = icaltime_from_timet (date_time, FALSE);
+ icaltime = icaltime_from_timet_with_zone (date_time, FALSE, NULL);
if (!icaltime_is_valid_time (icaltime))
date_time = -1;
}
@@ -4604,7 +4604,7 @@ camel_imapx_server_append_message_sync (CamelIMAPXServer *is,
date_time = camel_message_info_get_date_received (mi);
if (date_time > 0) {
- icaltime = icaltime_from_timet (date_time, FALSE);
+ icaltime = icaltime_from_timet_with_zone (date_time, FALSE, NULL);
if (!icaltime_is_valid_time (icaltime))
date_time = -1;
}
diff --git a/tests/libecal/client/test-cal-client-bulk-methods.c
b/tests/libecal/client/test-cal-client-bulk-methods.c
index ead5ff7..9714242 100644
--- a/tests/libecal/client/test-cal-client-bulk-methods.c
+++ b/tests/libecal/client/test-cal-client-bulk-methods.c
@@ -197,7 +197,7 @@ run_test_bulk_methods (ETestServerFixture *fixture,
summary = g_strdup_printf ("Test summary %d", i);
icalcomponent_set_summary (icalcomp, summary);
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 *
60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) +
60 * 60 * 60, 0, NULL));
icalcomps = g_slist_append (icalcomps, icalcomp);
g_free (summary);
diff --git a/tests/libecal/client/test-cal-client-create-object.c
b/tests/libecal/client/test-cal-client-create-object.c
index c4d270c..29e04b8 100644
--- a/tests/libecal/client/test-cal-client-create-object.c
+++ b/tests/libecal/client/test-cal-client-create-object.c
@@ -73,7 +73,7 @@ test_create_object_sync (ETestServerFixture *fixture,
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Test event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
if (!e_cal_client_create_object_sync (cal_client, icalcomp, &uid, NULL, &error))
g_error ("create object sync: %s", error->message);
@@ -208,7 +208,7 @@ test_create_object_async (ETestServerFixture *fixture,
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Test event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
data.icalcomp = icalcomp;
data.loop = fixture->loop;
diff --git a/tests/libecal/client/test-cal-client-get-attachment-uris.c
b/tests/libecal/client/test-cal-client-get-attachment-uris.c
index 959e8e0..49cad5a 100644
--- a/tests/libecal/client/test-cal-client-get-attachment-uris.c
+++ b/tests/libecal/client/test-cal-client-get-attachment-uris.c
@@ -64,7 +64,7 @@ setup_cal (ECalClient *cal_client)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Test event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
add_attach (icalcomp, ATTACH1);
add_attach (icalcomp, ATTACH2);
add_attach (icalcomp, ATTACH3);
diff --git a/tests/libecal/client/test-cal-client-get-object-list.c
b/tests/libecal/client/test-cal-client-get-object-list.c
index 58e501a..3143dcd 100644
--- a/tests/libecal/client/test-cal-client-get-object-list.c
+++ b/tests/libecal/client/test-cal-client-get-object-list.c
@@ -40,7 +40,7 @@ setup_cal (ECalClient *cal_client)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, EVENT_SUMMARY);
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
if (!e_cal_client_create_object_sync (cal_client, icalcomp, &uid, NULL, &error))
g_error ("create object sync: %s", error->message);
diff --git a/tests/libecal/client/test-cal-client-get-revision.c
b/tests/libecal/client/test-cal-client-get-revision.c
index c0b2c63..305f15f 100644
--- a/tests/libecal/client/test-cal-client-get-revision.c
+++ b/tests/libecal/client/test-cal-client-get-revision.c
@@ -38,7 +38,7 @@ get_revision_compare_cycle (ECalClient *client)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Test event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
&revision_before, NULL, &error))
diff --git a/tests/libecal/client/test-cal-client-get-view.c b/tests/libecal/client/test-cal-client-get-view.c
index 2a6f135..47514cc 100644
--- a/tests/libecal/client/test-cal-client-get-view.c
+++ b/tests/libecal/client/test-cal-client-get-view.c
@@ -123,7 +123,7 @@ alter_cal_client (gpointer user_data)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Initial event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
if (!e_cal_client_create_object_sync (cal_client, icalcomp, &uid, NULL, &error))
g_error ("create object sync: %s", error->message);
diff --git a/tests/libecal/client/test-cal-client-modify-object.c
b/tests/libecal/client/test-cal-client-modify-object.c
index 70025d4..62afb49 100644
--- a/tests/libecal/client/test-cal-client-modify-object.c
+++ b/tests/libecal/client/test-cal-client-modify-object.c
@@ -39,7 +39,7 @@ setup_cal (ECalClient *cal_client)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Initial" EVENT_SUMMARY);
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
if (!e_cal_client_create_object_sync (cal_client, icalcomp, &uid, NULL, &error))
g_error ("create object sync: %s", error->message);
diff --git a/tests/libecal/client/test-cal-client-receive-objects.c
b/tests/libecal/client/test-cal-client-receive-objects.c
index 3c661b3..edc5925 100644
--- a/tests/libecal/client/test-cal-client-receive-objects.c
+++ b/tests/libecal/client/test-cal-client-receive-objects.c
@@ -35,7 +35,7 @@ create_object (void)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "To-be-received event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
return icalcomp;
}
diff --git a/tests/libecal/client/test-cal-client-refresh.c b/tests/libecal/client/test-cal-client-refresh.c
index 78f2ad1..4eaf841 100644
--- a/tests/libecal/client/test-cal-client-refresh.c
+++ b/tests/libecal/client/test-cal-client-refresh.c
@@ -38,7 +38,7 @@ setup_cal (ECalClient *cal_client)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Test event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
if (!e_cal_client_create_object_sync (cal_client, icalcomp, &uid, NULL, &error))
g_error ("create object sync: %s", error->message);
diff --git a/tests/libecal/client/test-cal-client-remove-object.c
b/tests/libecal/client/test-cal-client-remove-object.c
index 9fa7619..be5dcbe 100644
--- a/tests/libecal/client/test-cal-client-remove-object.c
+++ b/tests/libecal/client/test-cal-client-remove-object.c
@@ -39,7 +39,7 @@ create_object (ECalClient *cal_client)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "To-be-removed event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
if (!e_cal_client_create_object_sync (cal_client, icalcomp, &uid, NULL, &error))
g_error ("create object sync: %s", error->message);
diff --git a/tests/libecal/client/test-cal-client-revision-view.c
b/tests/libecal/client/test-cal-client-revision-view.c
index 93d54b8..0e25114 100644
--- a/tests/libecal/client/test-cal-client-revision-view.c
+++ b/tests/libecal/client/test-cal-client-revision-view.c
@@ -160,7 +160,7 @@ alter_cal_client (gpointer user_data)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Initial event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
if (!e_cal_client_create_object_sync (cal_client, icalcomp, &uid, NULL, &error))
g_error ("create object sync: %s", error->message);
diff --git a/tests/libecal/client/test-cal-client-send-objects.c
b/tests/libecal/client/test-cal-client-send-objects.c
index f067f58..609f240 100644
--- a/tests/libecal/client/test-cal-client-send-objects.c
+++ b/tests/libecal/client/test-cal-client-send-objects.c
@@ -74,7 +74,7 @@ create_object (void)
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "To-be-sent event summary");
icalcomponent_set_dtstart (icalcomp, now);
- icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
+ icalcomponent_set_dtend (icalcomp, icaltime_from_timet_with_zone (icaltime_as_timet (now) + 60 * 60
* 60, 0, NULL));
return icalcomp;
}
diff --git a/tests/libedata-cal/test-intervaltree.c b/tests/libedata-cal/test-intervaltree.c
index ae8f5e9..8d90a35 100644
--- a/tests/libedata-cal/test-intervaltree.c
+++ b/tests/libedata-cal/test-intervaltree.c
@@ -153,11 +153,11 @@ create_test_component (time_t start,
ECalComponentDateTime dtstart, dtend;
struct icaltimetype time_start, time_end;
*
- time_start = icaltime_from_timet (start, 0);
- dtstart.value = icaltime_from_timet (start, 0);
+ time_start = icaltime_from_timet_with_zone (start, 0, NULL);
+ dtstart.value = icaltime_from_timet_with_zone (start, 0, NULL);
dtstart.zone = icaltimezone_get_utc_timezone ();
*
- dtend.value = icaltime_from_timet (end, 0);
+ dtend.value = icaltime_from_timet_with_zone (end, 0, NULL);
dtend.value = icaltimezone_get_utc_timezone ();
e_cal_component_set_dtstart (comp, &dtstart);
e_cal_component_set_dtend (comp, &dtend);
@@ -170,7 +170,7 @@ create_test_component (time_t start,
g_free ((gchar *) summary.value);
- current = icaltime_from_timet (time (NULL), 0);
+ current = icaltime_from_timet_with_zone (time (NULL), 0, NULL);
e_cal_component_set_created (comp, ¤t);
e_cal_component_set_last_modified (comp, ¤t);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]