summaryrefslogtreecommitdiffstats
path: root/libkcal/icalformatimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkcal/icalformatimpl.cpp')
-rw-r--r--libkcal/icalformatimpl.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index 0c7b40e2..e4296bce 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -1932,6 +1932,9 @@ icaltimetype ICalFormatImpl::writeICalDate(const TQDate &date)
t.second = 0;
t.is_date = 1;
+#ifndef USE_LIBICAL_3_0
+ t.is_utc = 0;
+#endif
t.zone = 0;
return t;
@@ -1951,6 +1954,9 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const TQDateTime &datetime)
t.is_date = 0;
t.zone = icaltimezone_get_builtin_timezone ( mParent->timeZoneId().latin1() );
+#ifndef USE_LIBICAL_3_0
+ t.is_utc = 0;
+#endif
// _dumpIcaltime( t );
/* The TQDateTime we get passed in is to be considered in the timezone of
@@ -1965,6 +1971,9 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const TQDateTime &datetime)
t.zone = tz;
t = icaltime_convert_to_zone( t, utc );
} else {
+#ifndef USE_LIBICAL_3_0
+ t.is_utc = 1;
+#endif
t.zone = utc;
}
}
@@ -1976,7 +1985,12 @@ icaltimetype ICalFormatImpl::writeICalDateTime(const TQDateTime &datetime)
TQDateTime ICalFormatImpl::readICalDateTime( icalproperty *p, icaltimetype& t, icaltimezone* tz )
{
// kdDebug(5800) << "ICalFormatImpl::readICalDateTime()" << endl;
- if (!icaltime_is_utc(t)) { // Only use the TZ if time is not UTC.
+#ifdef USE_LIBICAL_3_0
+ bool time_is_utc = icaltime_is_utc(t);
+#else
+ bool time_is_utc = t.is_utc;
+#endif
+ if ( !time_is_utc ) { // 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.
icalparameter *param = p ? icalproperty_get_first_parameter(p, ICAL_TZID_PARAMETER) : 0;
@@ -1992,9 +2006,15 @@ TQDateTime ICalFormatImpl::readICalDateTime( icalproperty *p, icaltimetype& t, i
}
else {
if (tz && tz != icaltimezone_get_utc_timezone()) {
+#ifndef USE_LIBICAL_3_0
+ t.is_utc = 0;
+#endif
t.zone = tz;
}
else {
+#ifndef USE_LIBICAL_3_0
+ t.is_utc = 1;
+#endif
t.zone = icaltimezone_get_utc_timezone();
}
}