Fix build without features.timezone

Change-Id: I3f8421103afa61baf415636b4dc8cf93fb477bcc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Tasuku Suzuki 2018-05-07 11:34:44 +09:00
parent f72777b969
commit 8f7dcba204
2 changed files with 6 additions and 0 deletions

View File

@ -44,7 +44,9 @@
#include "qset.h"
#include "qlocale.h"
#include "qdatetime.h"
#if QT_CONFIG(timezone)
#include "qtimezone.h"
#endif
#include "qregexp.h"
#include "qdebug.h"

View File

@ -55,7 +55,9 @@
#include <qcache.h>
#include <qregularexpression.h>
#endif
#if QT_CONFIG(timezone)
#include <QTimeZone>
#endif
#include <QScopedValueRollback>
#if defined Q_OS_WIN
@ -438,8 +440,10 @@ static QString timespecToString(const QDateTime &dateTime)
return QStringLiteral("Z");
case Qt::OffsetFromUTC:
return secondsToOffset(dateTime.offsetFromUtc());
#if QT_CONFIG(timezone)
case Qt::TimeZone:
return secondsToOffset(dateTime.timeZone().offsetFromUtc(dateTime));
#endif
default:
return QString();
}