aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/debugger/qqmldebugconnector.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-05 17:27:08 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-08-13 08:30:47 +0000
commitfbdc01f141a4ec4e6fc78ea69d86ff7aa128bf72 (patch)
tree4529687ecc253a463abdd568f717143ec966dbb0 /src/qml/debugger/qqmldebugconnector.cpp
parentfc3403502fed19e0b8ab5a85b0c3aa2587e22475 (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/qqmldebugconnector.cpp')
-rw-r--r--src/qml/debugger/qqmldebugconnector.cpp12
1 files changed, 11 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);
}
}
}