diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp | 6 | ||||
| -rw-r--r-- | src/qml/debugger/qqmldebugconnector.cpp | 12 | ||||
| -rw-r--r-- | src/qml/debugger/qqmldebugconnector_p.h | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp index 2983c95356..1cfebea03c 100644 --- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp +++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp @@ -333,6 +333,7 @@ void QQmlDebugServerImpl::parseArguments() bool ok = false; QString hostAddress; QString fileName; + QStringList services; const QStringList lstjsDebugArguments = args.split(QLatin1Char(',')); QStringList::const_iterator argsItEnd = lstjsDebugArguments.cend(); @@ -361,6 +362,10 @@ void QQmlDebugServerImpl::parseArguments() } else if (strArgument.startsWith(QLatin1String("file:"))) { fileName = strArgument.mid(5); ok = !fileName.isEmpty(); + } else if (strArgument.startsWith(QLatin1String("services:"))) { + services.append(strArgument.mid(9)); + } else if (!services.isEmpty()) { + services.append(strArgument); } else { qWarning() << QString::fromLatin1("QML Debugger: Invalid argument '%1' " "detected. Ignoring the same.") @@ -369,6 +374,7 @@ void QQmlDebugServerImpl::parseArguments() } if (ok) { + setServices(services); m_blockingMode = block; if (!fileName.isEmpty()) m_thread.setFileName(fileName); diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp index 393185bf0d..8de734fa68 100644 --- a/src/qml/debugger/qqmldebugconnector.cpp +++ b/src/qml/debugger/qqmldebugconnector.cpp @@ -56,6 +56,7 @@ Q_QML_IMPORT_DEBUG_PLUGIN(QQmlDebuggerServiceFactory) struct QQmlDebugConnectorParams { QString pluginKey; + QStringList services; QString arguments; QQmlDebugConnector *instance; @@ -83,6 +84,13 @@ void QQmlDebugConnector::setPluginKey(const QString &key) } } +void QQmlDebugConnector::setServices(const QStringList &services) +{ + QQmlDebugConnectorParams *params = qmlDebugConnectorParams(); + if (params) + params->services = services; +} + QString QQmlDebugConnector::commandLineArguments() { QQmlDebugConnectorParams *params = qmlDebugConnectorParams(); @@ -119,7 +127,9 @@ QQmlDebugConnector *QQmlDebugConnector::instance() foreach (const QJsonObject &object, metaDataForQQmlDebugService()) { foreach (const QJsonValue &key, object.value(QLatin1String("MetaData")).toObject() .value(QLatin1String("Keys")).toArray()) { - loadQQmlDebugService(key.toString()); + QString keyString = key.toString(); + if (params->services.isEmpty() || params->services.contains(keyString)) + loadQQmlDebugService(keyString); } } } diff --git a/src/qml/debugger/qqmldebugconnector_p.h b/src/qml/debugger/qqmldebugconnector_p.h index 02e94811a6..f5f5a87b56 100644 --- a/src/qml/debugger/qqmldebugconnector_p.h +++ b/src/qml/debugger/qqmldebugconnector_p.h @@ -58,6 +58,7 @@ class Q_QML_PRIVATE_EXPORT QQmlDebugConnector : public QObject Q_OBJECT public: static void setPluginKey(const QString &key); + static void setServices(const QStringList &services); static QQmlDebugConnector *instance(); virtual bool blockingMode() const = 0; |
