! *\brief Called when a subscription is loaded. * Checks whether every saved subscription was loaded or not. * If everything is loaded, it makes the connection and starts the reading * * \param name, the name of the subscription */
| 1096 | * \param name, the name of the subscription |
| 1097 | */ |
| 1098 | void MQTTClient::subscriptionLoaded(const QString& name) { |
| 1099 | if (!name.isEmpty()) { |
| 1100 | // qDebug() << "Finished loading: " << name; |
| 1101 | // Save information about the subscription |
| 1102 | m_subscriptionsLoaded++; |
| 1103 | m_subscriptions.push_back(name); |
| 1104 | QMqttTopicFilter filter{name}; |
| 1105 | m_subscribedTopicNameQoS[filter] = 0; |
| 1106 | |
| 1107 | // Save the topics belonging to the subscription |
| 1108 | for (const auto* subscription : m_MQTTSubscriptions) { |
| 1109 | if (subscription->subscriptionName() == name) { |
| 1110 | const auto& topics = subscription->topics(); |
| 1111 | for (auto* topic : topics) { |
| 1112 | m_topicNames.push_back(topic->topicName()); |
| 1113 | } |
| 1114 | break; |
| 1115 | } |
| 1116 | } |
| 1117 | |
| 1118 | // Check whether every subscription was loaded or not |
| 1119 | if (m_subscriptionsLoaded == m_subscriptionCountToLoad) { |
| 1120 | // if everything was loaded we can start reading |
| 1121 | m_loaded = true; |
| 1122 | read(); |
| 1123 | } |
| 1124 | } |
| 1125 | } |
| 1126 | |
| 1127 | // ############################################################################## |
| 1128 | // ################## Serialization/Deserialization ########################### |
nothing calls this directly
no test coverage detected