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 "qset.h"
#include "qlocale.h" #include "qlocale.h"
#include "qdatetime.h" #include "qdatetime.h"
#if QT_CONFIG(timezone)
#include "qtimezone.h" #include "qtimezone.h"
#endif
#include "qregexp.h" #include "qregexp.h"
#include "qdebug.h" #include "qdebug.h"

View File

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