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

Method buildMqttPublisherModel

app/src/DataModel/ProjectEditor.cpp:2023–2048  ·  view source on GitHub ↗

* @brief Rebuilds the MQTT Publisher form model from the live Publisher singleton. */

Source from the content-addressed store, hash-verified

2021 * @brief Rebuilds the MQTT Publisher form model from the live Publisher singleton.
2022 */
2023void DataModel::ProjectEditor::buildMqttPublisherModel()
2024{
2025 if (m_mqttPublisherModel) {
2026 m_mqttPublisherModel->disconnect(this);
2027 m_mqttPublisherModel->deleteLater();
2028 m_mqttPublisherModel = nullptr;
2029 }
2030
2031 m_mqttPublisherModel = new CustomModel(this);
2032
2033#ifdef BUILD_COMMERCIAL
2034 const auto& pub = MQTT::Publisher::instance();
2035 const bool enabled = pub.enabled();
2036
2037 buildMqttPublishingSection(pub, enabled);
2038 buildMqttBrokerSection(pub, enabled);
2039 buildMqttSslSection(pub, enabled);
2040#endif
2041
2042 connect(m_mqttPublisherModel,
2043 &CustomModel::itemChanged,
2044 this,
2045 &DataModel::ProjectEditor::onMqttPublisherItemChanged);
2046
2047 Q_EMIT mqttPublisherModelChanged();
2048}
2049
2050#ifdef BUILD_COMMERCIAL
2051/**

Callers

nothing calls this directly

Calls 2

disconnectMethod · 0.45
enabledMethod · 0.45

Tested by

no test coverage detected