summaryrefslogtreecommitdiffstats
path: root/tradeshow/iot-sensortag/mqttupdate.cpp
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2018-10-24 16:07:05 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2018-10-25 06:05:24 +0000
commitd59d4b183c3484a978f197ad27e2491138775c92 (patch)
tree212d9a4d6e7a5264ab5ff14f18ecb531257eda9b /tradeshow/iot-sensortag/mqttupdate.cpp
parentc0917669684e051f79f6afb557bb491828346a47 (diff)
SensorTag: Prefer loading MQTT configuration from file
To avoid accidently pushing credentials, they should not be patched into the header, but rather be placed in to a file co-located to the executable. Change-Id: I03950107f39a88b0f1c7deb49ff16d25ddf9df4d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'tradeshow/iot-sensortag/mqttupdate.cpp')
-rw-r--r--tradeshow/iot-sensortag/mqttupdate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tradeshow/iot-sensortag/mqttupdate.cpp b/tradeshow/iot-sensortag/mqttupdate.cpp
index 45ea238..87a8416 100644
--- a/tradeshow/iot-sensortag/mqttupdate.cpp
+++ b/tradeshow/iot-sensortag/mqttupdate.cpp
@@ -357,10 +357,10 @@ MqttEventHandler::MqttEventHandler(const QString &name, QObject *parent)
connect(&m_pingTimer, &QTimer::timeout, this, &MqttEventHandler::sendAlive);
m_client = new QMqttClient;
- m_client->setHostname(QLatin1String(MQTT_BROKER));
- m_client->setPort(MQTT_PORT);
- m_client->setUsername(QByteArray(MQTT_USERNAME));
- m_client->setPassword(QByteArray(MQTT_PASSWORD));
+ m_client->setHostname(MqttCredentials::getBroker());
+ m_client->setPort(MqttCredentials::getPort());
+ m_client->setUsername(MqttCredentials::getUsername());
+ m_client->setPassword(MqttCredentials::getPassword());
m_client->setWillMessage(QString::fromLocal8Bit("%1>Offline").arg(m_deviceName).toLocal8Bit());
m_client->setWillQoS(1);