summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-08-30 16:28:47 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-03 23:53:30 +0200
commitf9c0948343efdaf04be7a97546964ea4987b74d0 (patch)
tree0a0d6ee630b358f7aa25e72684f890ba20a5b163 /src
parent5b4b3fb34679c2768d5c830cb8b9c88506aca75b (diff)
downloadqtxmlpatterns-f9c0948343efdaf04be7a97546964ea4987b74d0.tar.gz
Use the new, non-deprecated QDateTime functions for UTC offset
Change-Id: Ia7f8c08bba44fbb01d3babeed7a430dcb9660b99 Reviewed-by: John Layt <jlayt@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/xmlpatterns/data/qabstractdatetime.cpp6
-rw-r--r--src/xmlpatterns/functions/qdatetimefns_tpl_p.h2
-rw-r--r--src/xmlpatterns/functions/qtimezonefns.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/xmlpatterns/data/qabstractdatetime.cpp b/src/xmlpatterns/data/qabstractdatetime.cpp
index 80d5bda..2b14fd9 100644
--- a/src/xmlpatterns/data/qabstractdatetime.cpp
+++ b/src/xmlpatterns/data/qabstractdatetime.cpp
@@ -284,7 +284,7 @@ void AbstractDateTime::setUtcOffset(QDateTime &result,
else
{
Q_ASSERT(zoResult == Offset);
- result.setUtcOffset(zoOffset);
+ result.setOffsetFromUtc(zoOffset);
}
}
@@ -350,7 +350,7 @@ QString AbstractDateTime::zoneOffsetToString() const
{
Q_ASSERT(m_dateTime.timeSpec() == Qt::OffsetFromUTC);
- const int zoneOffset = m_dateTime.utcOffset();
+ const int zoneOffset = m_dateTime.offsetFromUtc();
Q_ASSERT(zoneOffset != 0);
const int posZoneOffset = qAbs(zoneOffset);
@@ -384,7 +384,7 @@ void AbstractDateTime::copyTimeSpec(const QDateTime &from,
}
case Qt::OffsetFromUTC:
{
- to.setUtcOffset(from.utcOffset());
+ to.setOffsetFromUtc(from.offsetFromUtc());
Q_ASSERT(to.timeSpec() == Qt::OffsetFromUTC);
return;
}
diff --git a/src/xmlpatterns/functions/qdatetimefns_tpl_p.h b/src/xmlpatterns/functions/qdatetimefns_tpl_p.h
index eb717c5..239d87a 100644
--- a/src/xmlpatterns/functions/qdatetimefns_tpl_p.h
+++ b/src/xmlpatterns/functions/qdatetimefns_tpl_p.h
@@ -128,7 +128,7 @@ Item TimezoneFromAbstractDateTimeFN::extract(const QDateTime &dt) const
if(dt.timeSpec() == Qt::UTC)
return toItem(CommonValues::DayTimeDurationZero);
else if(dt.timeSpec() == Qt::OffsetFromUTC)
- return toItem(DayTimeDuration::fromSeconds(dt.utcOffset()));
+ return toItem(DayTimeDuration::fromSeconds(dt.offsetFromUtc()));
else
return Item();
}
diff --git a/src/xmlpatterns/functions/qtimezonefns.cpp b/src/xmlpatterns/functions/qtimezonefns.cpp
index 1e7a4cf..6145217 100644
--- a/src/xmlpatterns/functions/qtimezonefns.cpp
+++ b/src/xmlpatterns/functions/qtimezonefns.cpp
@@ -110,7 +110,7 @@ Item AdjustTimezone::evaluateSingleton(const DynamicContext::Ptr &context) const
* the empty sequence, then the result is $arg with $timezone as
* the timezone component." */
//dt.setTimeSpec(QDateTime::Spec(QDateTime::OffsetFromUTC, tzSecs));
- dt.setUtcOffset(tzSecs);
+ dt.setOffsetFromUtc(tzSecs);
Q_ASSERT(dt.isValid());
return createValue(dt);
}
@@ -122,7 +122,7 @@ Item AdjustTimezone::evaluateSingleton(const DynamicContext::Ptr &context) const
dt = dt.toUTC();
dt = dt.addSecs(tzSecs);
//dt.setTimeSpec(QDateTime::Spec(QDateTime::OffsetFromUTC, tzSecs));
- dt.setUtcOffset(tzSecs);
+ dt.setOffsetFromUtc(tzSecs);
Q_ASSERT(dt.isValid());
return createValue(dt);
}