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

Method hasCredentials

app/src/MQTT/CredentialVault.cpp:75–87  ·  view source on GitHub ↗

* @brief Returns true when either a username or a password is stored for host:port. */

Source from the content-addressed store, hash-verified

73 * @brief Returns true when either a username or a password is stored for host:port.
74 */
75bool MQTT::CredentialVault::hasCredentials(const QString& host, quint16 port) const
76{
77 if (host.isEmpty())
78 return false;
79
80 const auto key = settingsKey(host, port);
81 m_settings.beginGroup(QStringLiteral("mqtt/credentials"));
82 const bool present = m_settings.contains(key + QStringLiteral("/user"))
83 || m_settings.contains(key + QStringLiteral("/pass"));
84 m_settings.endGroup();
85
86 return present;
87}
88
89//--------------------------------------------------------------------------------------------------
90// Mutations

Callers 2

publisherGetConfigMethod · 0.80
subscriberGetConfigMethod · 0.80

Calls 2

isEmptyMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected