From cdb78c534a09ecc672ffbeb48e000adf377cccf1 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 7 Mar 2012 16:37:39 +0100 Subject: [PATCH] QmlTooling: Parse messages from latest Qt5 Change-Id: I5b2574d5dd2fecbf483a2e33feb8674846b84a59 Reviewed-by: Aurindam Jana --- .../qdeclarativeoutputparser.cpp | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/libs/qmljsdebugclient/qdeclarativeoutputparser.cpp b/src/libs/qmljsdebugclient/qdeclarativeoutputparser.cpp index 639d8836f57..31abb34fa48 100644 --- a/src/libs/qmljsdebugclient/qdeclarativeoutputparser.cpp +++ b/src/libs/qmljsdebugclient/qdeclarativeoutputparser.cpp @@ -57,13 +57,24 @@ void QDeclarativeOutputParser::processOutput(const QString &output) const QString msg = m_buffer.left(nlIndex); m_buffer = m_buffer.right(m_buffer.size() - nlIndex - 1); - static const QString qddserver = QLatin1String("QDeclarativeDebugServer: "); + // used in Qt4 + static const QString qddserver4 = QLatin1String("QDeclarativeDebugServer: "); + // used in Qt5 + static const QString qddserver5 = QLatin1String("QML Debugger: "); - const int index = msg.indexOf(qddserver); + QString status; + int index = msg.indexOf(qddserver4); if (index != -1) { - QString status = msg; - status.remove(0, index + qddserver.length()); // chop of 'QDeclarativeDebugServer: ' - + status = msg; + status.remove(0, index + qddserver4.length()); // chop of 'QDeclarativeDebugServer: ' + } else { + index = msg.indexOf(qddserver5); + if (index != -1) { + status = msg; + status.remove(0, index + qddserver5.length()); // chop of 'QML Debugger: ' + } + } + if (!status.isEmpty()) { static QString waitingForConnection = QLatin1String(Constants::STR_WAITING_FOR_CONNECTION); static QString unableToListen = QLatin1String(Constants::STR_UNABLE_TO_LISTEN); static QString debuggingNotEnabled = QLatin1String(Constants::STR_IGNORING_DEBUGGER);