diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-05 17:27:08 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-13 08:30:47 +0000 |
commit | fbdc01f141a4ec4e6fc78ea69d86ff7aa128bf72 (patch) | |
tree | 4529687ecc253a463abdd568f717143ec966dbb0 /src | |
parent | fc3403502fed19e0b8ab5a85b0c3aa2587e22475 (diff) |
Allow specification of loadable debug services via command line
We don't want to load the debugger when profiling and vice versa. This
makes it easier to prevent unwanted services from getting loaded.
Task-number: QTBUG-47623
Change-Id: I28893b6218110274a6d30b27805d89dbb443add3
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
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; |