aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-02-08 15:38:54 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-03-21 10:35:46 +0000
commit74e0f2573decb90d3e5b143abe9b20bc8a5f08a7 (patch)
tree86bbffabe6eeb7e01f574672c3fdd2fa56ad4129
parentbc4455cda2ae395f2943cd9f18b6ae51a676399a (diff)
QmlDebug: Drop support for non-multipacket clients
All known clients support multipackets by now. Change-Id: I74f017f5e11b01ee967fcfb5cecfefa54aad8ef7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
index 1814e28b83..0a468c0b84 100644
--- a/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
+++ b/src/plugins/qmltooling/qmldbg_server/qqmldebugserver.cpp
@@ -183,7 +183,6 @@ private:
QStringList m_clientPlugins;
bool m_gotHello;
bool m_blockingMode;
- bool m_clientSupportsMultiPackets;
QHash<QJSEngine *, EngineCondition> m_engineConditions;
@@ -276,8 +275,7 @@ static void cleanupOnShutdown()
QQmlDebugServerImpl::QQmlDebugServerImpl() :
m_connection(nullptr),
m_gotHello(false),
- m_blockingMode(false),
- m_clientSupportsMultiPackets(false)
+ m_blockingMode(false)
{
static bool postRoutineAdded = false;
if (!postRoutineAdded) {
@@ -463,10 +461,9 @@ void QQmlDebugServerImpl::receiveMessage()
s_dataStreamVersion = QDataStream::Qt_DefaultCompiledVersion;
}
+ bool clientSupportsMultiPackets = false;
if (!in.atEnd())
- in >> m_clientSupportsMultiPackets;
- else
- m_clientSupportsMultiPackets = false;
+ in >> clientSupportsMultiPackets;
// Send the hello answer immediately, since it needs to arrive before
// the plugins below start sending messages.
@@ -474,13 +471,15 @@ void QQmlDebugServerImpl::receiveMessage()
QQmlDebugPacket out;
QStringList pluginNames;
QList<float> pluginVersions;
- const int count = m_plugins.count();
- pluginNames.reserve(count);
- pluginVersions.reserve(count);
- for (QHash<QString, QQmlDebugService *>::ConstIterator i = m_plugins.constBegin();
- i != m_plugins.constEnd(); ++i) {
- pluginNames << i.key();
- pluginVersions << i.value()->version();
+ if (clientSupportsMultiPackets) { // otherwise, disable all plugins
+ const int count = m_plugins.count();
+ pluginNames.reserve(count);
+ pluginVersions.reserve(count);
+ 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
@@ -700,16 +699,11 @@ void QQmlDebugServerImpl::sendMessage(const QString &name, const QByteArray &mes
void QQmlDebugServerImpl::sendMessages(const QString &name, const QList<QByteArray> &messages)
{
if (canSendMessage(name)) {
- if (m_clientSupportsMultiPackets) {
- QQmlDebugPacket out;
- out << name;
- for (const QByteArray &message : messages)
- out << message;
- m_protocol->send(out.data());
- } else {
- for (const QByteArray &message : messages)
- doSendMessage(name, message);
- }
+ QQmlDebugPacket out;
+ out << name;
+ for (const QByteArray &message : messages)
+ out << message;
+ m_protocol->send(out.data());
m_connection->flush();
}
}