* @brief Rebuilds the MQTT Publisher form model from the live Publisher singleton. */
| 2021 | * @brief Rebuilds the MQTT Publisher form model from the live Publisher singleton. |
| 2022 | */ |
| 2023 | void 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 | /** |
nothing calls this directly
no test coverage detected