aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2013-12-02 15:46:22 +0100
committerhjk <hjk121@nokiamail.com>2013-12-02 16:43:26 +0100
commitb0da255acf86f67a53e31cee59a7829b8b6a1610 (patch)
tree4d53e64f481e549642abe9c4a3635a0824ab44c2
parentcfe84eaae2a41efd3758174a3d4da2d4a4f2826a (diff)
Debugger: Restrict QTimeZone use to Qt >= 5.2
Change-Id: Iba786c265ddf7163fd7bb779d103065de3f83547 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Christian Stenger <christian.stenger@digia.com>
-rw-r--r--src/plugins/debugger/debuggerprotocol.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp
index 7f673ab8e2..b76bce3489 100644
--- a/src/plugins/debugger/debuggerprotocol.cpp
+++ b/src/plugins/debugger/debuggerprotocol.cpp
@@ -33,7 +33,9 @@
#include <QDateTime>
#include <QDebug>
#include <QHostAddress>
+#if QT_VERSION >= 0x050200
#include <QTimeZone>
+#endif
#include <ctype.h>
@@ -504,6 +506,7 @@ static QTime timeFromData(int ms)
return ms == -1 ? QTime() : QTime(0, 0, 0, 0).addMSecs(ms);
}
+#if QT_VERSION >= 0x050200
// Stolen and adapted from qdatetime.cpp
static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time)
{
@@ -550,6 +553,7 @@ static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time)
*date = (status & NullDate) ? QDate() : QDate::fromJulianDay(jd);
*time = (status & NullTime) ? QTime() : QTime::fromMSecsSinceStartOfDay(ds);
}
+#endif
QString decodeData(const QByteArray &ba, int encoding)
{
@@ -678,6 +682,7 @@ QString decodeData(const QByteArray &ba, int encoding)
return QString::fromUtf8(decodedBa);
}
case DateTimeInternal: { // 29, DateTimeInternal: msecs, spec, offset, tz, status
+#if QT_VERSION >= 0x050200
int p0 = ba.indexOf('/');
int p1 = ba.indexOf('/', p0 + 1);
int p2 = ba.indexOf('/', p1 + 1);
@@ -708,6 +713,10 @@ QString decodeData(const QByteArray &ba, int encoding)
dateTime = QDateTime(date, time, spec);
}
return dateTime.toString();
+#else
+ // "Very plain".
+ return QString::fromLatin1(ba);
+#endif
}
}
qDebug() << "ENCODING ERROR: " << encoding;