From af4516ac866cc877c3a033d6b837b30445ee8f1a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 26 Aug 2016 18:19:37 +0200 Subject: QmlDebug: Allow specifying debug connectors on the command line With this change arbitrary debug connector plugins can be loaded by specifying them in the "-qmljsdebugger=..." argument. It was already possible to load them by using startDebugConnector(...), but that requires source code modification. Change-Id: I06ec7f54ec65add7cff2846ed4083ea878a04765 Reviewed-by: Simon Hausmann --- src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp | 4 ++-- src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp index 9eeb285951..1a318b3ca2 100644 --- a/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp +++ b/src/plugins/qmltooling/qmldbg_native/qqmlnativedebugconnector.cpp @@ -183,7 +183,7 @@ QQmlNativeDebugConnector::QQmlNativeDebugConnector() : m_blockingMode(false) { const QString args = commandLineArguments(); - const auto lstjsDebugArguments = args.splitRef(QLatin1Char(',')); + const auto lstjsDebugArguments = args.splitRef(QLatin1Char(','), QString::SkipEmptyParts); QStringList services; for (const QStringRef &strArgument : lstjsDebugArguments) { if (strArgument == QLatin1String("block")) { @@ -195,7 +195,7 @@ QQmlNativeDebugConnector::QQmlNativeDebugConnector() services.append(strArgument.mid(9).toString()); } else if (!services.isEmpty()) { services.append(strArgument.toString()); - } else { + } else if (!strArgument.startsWith(QLatin1String("connector:"))) { qWarning("QML Debugger: Invalid argument \"%s\" detected. Ignoring the same.", strArgument.toUtf8().constData()); } diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp index f449989598..f6f48e43a4 100644 --- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp +++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp @@ -346,7 +346,7 @@ void QQmlDebugServerImpl::parseArguments() QString fileName; QStringList services; - const auto lstjsDebugArguments = args.splitRef(QLatin1Char(',')); + const auto lstjsDebugArguments = args.splitRef(QLatin1Char(','), QString::SkipEmptyParts); for (auto argsIt = lstjsDebugArguments.begin(), argsItEnd = lstjsDebugArguments.end(); argsIt != argsItEnd; ++argsIt) { const QStringRef &strArgument = *argsIt; if (strArgument.startsWith(QLatin1String("port:"))) { @@ -377,7 +377,7 @@ void QQmlDebugServerImpl::parseArguments() services.append(strArgument.mid(9).toString()); } else if (!services.isEmpty()) { services.append(strArgument.toString()); - } else { + } else if (!strArgument.startsWith(QLatin1String("connector:"))) { const QString message = tr("QML Debugger: Invalid argument \"%1\" detected." " Ignoring the same.").arg(strArgument.toString()); qWarning("%s", qPrintable(message)); -- cgit v1.2.3