diff options
author | Thiago Macieira <[email protected]> | 2013-07-09 14:19:45 -0700 |
---|---|---|
committer | Thiago Macieira <[email protected]> | 2013-08-23 21:36:39 +0200 |
commit | 62fb22278cc380239185038b43c3b915906cfd15 (patch) | |
tree | 97fe18c69b91b0e77abba144db835edac34a4cb7 /src/plugins/debugger/debuggerprotocol.cpp | |
parent | f6a9a69ee4bc9378aa4a22a0dc36ca8ebded674b (diff) |
Debugger: Add dumper support for IPv6 in QHostAddress
Change-Id: Ia542cf9e3c695a2c3c4b6340c3d72dfe743339c6
Reviewed-by: Thiago Macieira <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerprotocol.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerprotocol.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index b837ef80ce4..bb89c9adfe9 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -32,6 +32,7 @@ #include <QCoreApplication> #include <QDateTime> #include <QDebug> +#include <QHostAddress> #include <ctype.h> @@ -611,6 +612,18 @@ QString decodeData(const QByteArray &ba, int encoding) const QTime time = timeFromData(ba.mid(p + 1 ).toInt()); return QDateTime(date, time).toString(Qt::TextDate); } + case IPv6AddressAndHexScopeId: { // 27, 16 hex-encoded bytes, "%" and the string-encoded scope + const int p = ba.indexOf('%'); + QHostAddress ip6(QString::fromLatin1(p == -1 ? ba : ba.left(p))); + if (ip6.isNull()) + break; + + const QByteArray scopeId = p == -1 ? QByteArray() : QByteArray::fromHex(ba.mid(p + 1)); + if (!scopeId.isEmpty()) + ip6.setScopeId(QString::fromUtf16(reinterpret_cast<const ushort *>(scopeId.constData()), + scopeId.length() / 2)); + return ip6.toString(); + } } qDebug() << "ENCODING ERROR: " << encoding; return QCoreApplication::translate("Debugger", "<Encoding error>"); |