diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-02-11 15:58:55 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-02-13 09:54:40 +0900 |
commit | 3f26d326c9bd8fbd60e5d89e20a705c87a837b1f (patch) | |
tree | 4f7a65469f9a686f2c9e28d34e90b9e12d7f0e17 /libkcal | |
parent | ecde0bac61ec5d993f0ab1f240105bf32867a08b (diff) | |
download | tdepim-3f26d326c9bd8fbd60e5d89e20a705c87a837b1f.tar.gz tdepim-3f26d326c9bd8fbd60e5d89e20a705c87a837b1f.zip |
Fixed FTBFS caused by migration to libical 3. The changes
are compatible with previous versions of libical.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 8996740084e6d31d323cfeb1a269f8427ff3f6bf)
Diffstat (limited to 'libkcal')
-rw-r--r-- | libkcal/icalformatimpl.cpp | 10 | ||||
-rw-r--r-- | libkcal/vcalformat.cpp | 4 |
2 files changed, 3 insertions, 11 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 6e0b7f837..171fe8f82 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -1932,9 +1932,6 @@ icaltimetype ICalFormatImpl::writeICalDate(const TQDate &date) t.second = 0; t.is_date = 1; - - t.is_utc = 0; - t.zone = 0; return t; @@ -1954,7 +1951,6 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const TQDateTime &datetime) t.is_date = 0; t.zone = icaltimezone_get_builtin_timezone ( mParent->timeZoneId().latin1() ); - t.is_utc = 0; // _dumpIcaltime( t ); /* The TQDateTime we get passed in is to be considered in the timezone of @@ -1969,7 +1965,6 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const TQDateTime &datetime) t.zone = tz; t = icaltime_convert_to_zone( t, utc ); } else { - t.is_utc = 1; t.zone = utc; } } @@ -1981,11 +1976,10 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const TQDateTime &datetime) TQDateTime ICalFormatImpl::readICalDateTime( icalproperty *p, icaltimetype& t, icaltimezone* tz ) { // kdDebug(5800) << "ICalFormatImpl::readICalDateTime()" << endl; - if ( tz && t.is_utc == 0 ) { // Only use the TZ if time is not UTC. + if (tz && !icaltime_is_utc(t)) { // Only use the TZ if time is not UTC. // FIXME: We'll need to make sure to apply the appropriate TZ, not just // the first one found. - t.is_utc = (tz == icaltimezone_get_utc_timezone())?1:0; - if (t.is_utc == 0) { + if (tz != icaltimezone_get_utc_timezone()) { icalparameter *param = p ? icalproperty_get_first_parameter(p, ICAL_TZID_PARAMETER) : 0; const char *tzid = param ? icalparameter_get_tzid(param) : 0; if ( !tzid ) diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 7733b27dd..f78ad2a31 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp @@ -1341,9 +1341,7 @@ int vcaltime_utc_offset( TQDateTime ictt, TQString tzid ) // struct icaltimetype tt = icaltime_from_timet( ictt.toTime_t(), false ); // return icaltime_utc_offset( tt, tzid.latin1() ); int daylight; - struct icaltimetype tt = icaltime_from_timet( ictt.toTime_t(), false ); - //source says this is DEPRECATED, but it doesn't say what to use instead - //how to handle failure from icaltimezone_get_builtin_timezone_from_tzid()? + struct icaltimetype tt = icaltime_from_timet_with_zone( ictt.toTime_t(), false, NULL); return icaltimezone_get_utc_offset( icaltimezone_get_builtin_timezone( tzid.latin1() ), &tt, &daylight ); |