! *\brief called when the will statistics are changed in the will settings widget * adds or removes the statistic represented by the index from m_mqttClient */
| 646 | * adds or removes the statistic represented by the index from m_mqttClient |
| 647 | */ |
| 648 | void LiveDataDock::statisticsChanged(MQTTClient::WillStatisticsType willStatisticsType) { |
| 649 | if (willStatisticsType != MQTTClient::WillStatisticsType::NoStatistics) { |
| 650 | // if it's not already added and it's checked we add it |
| 651 | if (!m_mqttClient->willStatistics().at(static_cast<int>(willStatisticsType))) |
| 652 | m_mqttClient->addWillStatistics(willStatisticsType); |
| 653 | else // otherwise remove it |
| 654 | m_mqttClient->removeWillStatistics(willStatisticsType); |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | /*! |
| 659 | *\brief called when the client connects to the broker successfully, it subscribes to every topic (# wildcard) |
no test coverage detected