MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / buildMqttBrokerCredentials

Method buildMqttBrokerCredentials

app/src/DataModel/ProjectEditor.cpp:2242–2264  ·  view source on GitHub ↗

* @brief Appends the broker authentication rows (username, password). */

Source from the content-addressed store, hash-verified

2240 * @brief Appends the broker authentication rows (username, password).
2241 */
2242void DataModel::ProjectEditor::buildMqttBrokerCredentials(const MQTT::Publisher& pub, bool enabled)
2243{
2244 auto* userItem = new QStandardItem();
2245 userItem->setEditable(true);
2246 userItem->setData(enabled, Active);
2247 userItem->setData(TextField, WidgetType);
2248 userItem->setData(pub.username(), EditableValue);
2249 userItem->setData(kMqttPublisher_Username, ParameterType);
2250 userItem->setData(tr("Username"), ParameterName);
2251 userItem->setData(tr("Username for broker authentication (leave empty for anonymous)"),
2252 ParameterDescription);
2253 m_mqttPublisherModel->appendRow(userItem);
2254
2255 auto* passItem = new QStandardItem();
2256 passItem->setEditable(true);
2257 passItem->setData(enabled, Active);
2258 passItem->setData(PasswordField, WidgetType);
2259 passItem->setData(pub.password(), EditableValue);
2260 passItem->setData(kMqttPublisher_Password, ParameterType);
2261 passItem->setData(tr("Password"), ParameterName);
2262 passItem->setData(tr("Password for broker authentication"), ParameterDescription);
2263 m_mqttPublisherModel->appendRow(passItem);
2264}
2265
2266/**
2267 * @brief Appends the SSL/TLS section (toggle, protocol, peer verification, depth).

Callers

nothing calls this directly

Calls 2

usernameMethod · 0.45
passwordMethod · 0.45

Tested by

no test coverage detected