MCPcopy Create free account
hub / github.com/KDE/labplot / isMqttValid

Method isMqttValid

src/frontend/datasources/ImportFileWidget.cpp:2647–2658  ·  view source on GitHub ↗

! * returns \c true if there is a valid connection to an MQTT broker and the user has subscribed to at least 1 topic, * returns \c false otherwise. */

Source from the content-addressed store, hash-verified

2645 * returns \c false otherwise.
2646 */
2647bool ImportFileWidget::isMqttValid() {
2648 if (!m_client)
2649 return false;
2650 if (m_client->state() != QMqttClient::ClientState::Connected)
2651 return false;
2652 if (!m_subscriptionWidget->subscriptionCount())
2653 return false;
2654 if (this->currentFileType() != AbstractFileFilter::FileType::Ascii)
2655 return false;
2656
2657 return true;
2658}
2659
2660/*!
2661 *\brief called when the client connects to the broker successfully.

Callers 1

checkOkButtonMethod · 0.80

Calls 2

currentFileTypeMethod · 0.95
subscriptionCountMethod · 0.80

Tested by

no test coverage detected