diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-16 11:04:39 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-04 13:35:13 +0000 |
commit | 20d06b5e822cc301e31f77a87915eed62195eb92 (patch) | |
tree | af5f765dc4f58b67ce85a2030fe675554dc0f273 /src/plugins | |
parent | 229852304e4ea9622aa18f05e2f0ad88f305836f (diff) | |
download | qtdeclarative-20d06b5e822cc301e31f77a87915eed62195eb92.tar.gz qtdeclarative-20d06b5e822cc301e31f77a87915eed62195eb92.tar.bz2 qtdeclarative-20d06b5e822cc301e31f77a87915eed62195eb92.zip |
Don't ask QQmlDebugService for name() when we already know it
Change-Id: Ibae6602bd1725d98ddaa751bfc00391a20a1460e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp index 2d79777c2..91982b415 100644 --- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp +++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp @@ -231,11 +231,13 @@ void QQmlDebugServerImpl::cleanup() if (!server) return; - foreach (QQmlDebugService *service, server->m_plugins.values()) { + for (QHash<QString, QQmlDebugService *>::ConstIterator i = server->m_plugins.constBegin(); + i != server->m_plugins.constEnd(); ++i) { server->m_changeServiceStateCalls.ref(); QMetaObject::invokeMethod(server, "changeServiceState", Qt::QueuedConnection, - Q_ARG(QString, service->name()), - Q_ARG(QQmlDebugService::State, QQmlDebugService::NotConnected)); + Q_ARG(QString, i.key()), + Q_ARG(QQmlDebugService::State, + QQmlDebugService::NotConnected)); } // Wait for changeServiceState calls to finish @@ -458,13 +460,13 @@ void QQmlDebugServerImpl::receiveMessage() QQmlDebugStream out(&helloAnswer, QIODevice::WriteOnly); QStringList pluginNames; QList<float> pluginVersions; - const QList<QQmlDebugService*> debugServices = m_plugins.values(); - const int count = debugServices.count(); + const int count = m_plugins.count(); pluginNames.reserve(count); pluginVersions.reserve(count); - foreach (QQmlDebugService *service, debugServices) { - pluginNames << service->name(); - pluginVersions << service->version(); + for (QHash<QString, QQmlDebugService *>::ConstIterator i = m_plugins.constBegin(); + i != m_plugins.constEnd(); ++i) { + pluginNames << i.key(); + pluginVersions << i.value()->version(); } out << QString(QStringLiteral("QDeclarativeDebugClient")) << 0 << protocolVersion @@ -483,7 +485,7 @@ void QQmlDebugServerImpl::receiveMessage() if (m_clientPlugins.contains(iter.key())) newState = QQmlDebugService::Enabled; m_changeServiceStateCalls.ref(); - changeServiceState(iter.value()->name(), newState); + changeServiceState(iter.key(), newState); } m_helloCondition.wakeAll(); @@ -502,7 +504,7 @@ void QQmlDebugServerImpl::receiveMessage() if (oldClientPlugins.contains(pluginName) != m_clientPlugins.contains(pluginName)) { m_changeServiceStateCalls.ref(); - changeServiceState(iter.value()->name(), newState); + changeServiceState(iter.key(), newState); } } |