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/qml/debugger | |
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/qml/debugger')
-rw-r--r-- | src/qml/debugger/qqmldebugconnector.cpp | 12 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugconnector_p.h | 1 |
2 files changed, 12 insertions, 1 deletions
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; |