summaryrefslogtreecommitdiffstats
path: root/src/mqtt/qmqttclient.cpp
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2017-10-16 14:06:56 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2017-11-14 07:21:16 +0000
commit17ce0ba0846ba19bb1b61cb03cc0ccb6c25a2e61 (patch)
tree2826b133c979ff020da4c8c4039a45f5bd93cf09 /src/mqtt/qmqttclient.cpp
parentcd1d60ec71836d6c4e9cbfbf344ef9334a22cdc4 (diff)
Remove indirection from QMqttConnection to data values
Instead of querying the properties each time from the client, prefer to use QMqttClientPrivate, which stores the value types. Change-Id: I3f199029dc82077bd67a46a922206502b6519dfd Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/mqtt/qmqttclient.cpp')
-rw-r--r--src/mqtt/qmqttclient.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mqtt/qmqttclient.cpp b/src/mqtt/qmqttclient.cpp
index 69af887..6f5dfa8 100644
--- a/src/mqtt/qmqttclient.cpp
+++ b/src/mqtt/qmqttclient.cpp
@@ -271,10 +271,10 @@ QT_BEGIN_NAMESPACE
/*!
Creates a new MQTT client instance with the specified \a parent.
*/
-QMqttClient::QMqttClient(QObject *parent) : QObject(*(new QMqttClientPrivate), parent)
+QMqttClient::QMqttClient(QObject *parent) : QObject(*(new QMqttClientPrivate(this)), parent)
{
Q_D(QMqttClient);
- d->m_connection.setClient(this, d);
+ d->m_connection.setClientPrivate(d);
}
/*!
@@ -670,9 +670,10 @@ void QMqttClient::setError(ClientError e)
emit errorChanged(d->m_error);
}
-QMqttClientPrivate::QMqttClientPrivate()
+QMqttClientPrivate::QMqttClientPrivate(QMqttClient *c)
: QObjectPrivate()
{
+ m_client = c;
m_clientId = QUuid::createUuid().toString();
m_clientId.remove(QLatin1Char('{'), Qt::CaseInsensitive);
m_clientId.remove(QLatin1Char('}'), Qt::CaseInsensitive);