diff --git a/core/backends/bluetooth/bluetoothlinkprovider.cpp b/core/backends/bluetooth/bluetoothlinkprovider.cpp index 1415c191d..983a45185 100644 --- a/core/backends/bluetooth/bluetoothlinkprovider.cpp +++ b/core/backends/bluetooth/bluetoothlinkprovider.cpp @@ -18,7 +18,7 @@ BluetoothLinkProvider::BluetoothLinkProvider(bool isDisabled) , mServiceDiscoveryAgent(new QBluetoothServiceDiscoveryAgent(this)) , connectTimer(new QTimer(this)) { - this->disabled = isDisabled; + this->mDisabled = isDisabled; connectTimer->setInterval(30000); connectTimer->setSingleShot(false); @@ -33,7 +33,7 @@ BluetoothLinkProvider::BluetoothLinkProvider(bool isDisabled) void BluetoothLinkProvider::onStart() { qCDebug(KDECONNECT_CORE) << "BluetoothLinkProvider::onStart executed"; - if (!disabled) { + if (!mDisabled) { tryToInitialise(); } } @@ -60,7 +60,7 @@ void BluetoothLinkProvider::tryToInitialise() void BluetoothLinkProvider::onStop() { - if (!disabled) { + if (!mDisabled) { qCDebug(KDECONNECT_CORE) << "BluetoothLinkProvider::onStop executed"; if (!mBluetoothServer) { return; @@ -76,17 +76,17 @@ void BluetoothLinkProvider::onStop() void BluetoothLinkProvider::enable() { - if (disabled) { - disabled = false; + if (mDisabled) { + mDisabled = false; tryToInitialise(); } } void BluetoothLinkProvider::disable() { - if (!disabled) { - disabled = true; - this->onStop(); + if (!mDisabled) { + mDisabled = true; + onStop(); mBluetoothServer = nullptr; mServiceDiscoveryAgent = nullptr; @@ -96,7 +96,7 @@ void BluetoothLinkProvider::disable() void BluetoothLinkProvider::onNetworkChange() { qCDebug(KDECONNECT_CORE) << "BluetoothLinkProvider::onNetworkChange executed"; - if (!disabled) { + if (!mDisabled) { tryToInitialise(); } } diff --git a/core/backends/bluetooth/bluetoothlinkprovider.h b/core/backends/bluetooth/bluetoothlinkprovider.h index 1d31a614e..2a0051d08 100644 --- a/core/backends/bluetooth/bluetoothlinkprovider.h +++ b/core/backends/bluetooth/bluetoothlinkprovider.h @@ -74,7 +74,7 @@ private: QBluetoothServiceInfo mKdeconnectService; QBluetoothServiceDiscoveryAgent *mServiceDiscoveryAgent; QTimer *connectTimer; - bool disabled; + bool mDisabled; QMap mLinks; diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index cb44691b6..2107d7d0c 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -52,7 +52,7 @@ LanLinkProvider::LanLinkProvider(bool testMode, bool isDisabled) , m_mdnsDiscovery(this) #endif { - this->disabled = isDisabled; + this->m_disabled = isDisabled; m_combineNetworkChangeTimer.setInterval(0); // increase this if waiting a single event-loop iteration is not enough m_combineNetworkChangeTimer.setSingleShot(true); @@ -88,22 +88,22 @@ LanLinkProvider::~LanLinkProvider() void LanLinkProvider::enable() { - if (disabled == true) { - disabled = false; - this->onStart(); + if (m_disabled == true) { + m_disabled = false; + onStart(); } } void LanLinkProvider::disable() { - if (disabled == false) { - this->onStop(); - disabled = true; + if (m_disabled == false) { + onStop(); + m_disabled = true; } } void LanLinkProvider::onStart() { - if (disabled) { + if (m_disabled) { return; } @@ -139,7 +139,7 @@ void LanLinkProvider::onStart() void LanLinkProvider::onStop() { - if (disabled) { + if (m_disabled) { return; } #ifdef KDECONNECT_MDNS @@ -152,7 +152,7 @@ void LanLinkProvider::onStop() void LanLinkProvider::onNetworkChange() { - if (disabled) { + if (m_disabled) { return; } if (m_combineNetworkChangeTimer.isActive()) { @@ -165,7 +165,7 @@ void LanLinkProvider::onNetworkChange() // I'm in a new network, let's be polite and introduce myself void LanLinkProvider::combinedOnNetworkChange() { - if (disabled) { + if (m_disabled) { return; } if (!m_server->isListening()) { diff --git a/core/backends/lan/lanlinkprovider.h b/core/backends/lan/lanlinkprovider.h index 4eb2847f9..a02a2f1c1 100644 --- a/core/backends/lan/lanlinkprovider.h +++ b/core/backends/lan/lanlinkprovider.h @@ -95,7 +95,7 @@ private: const bool m_testMode; QTimer m_combineNetworkChangeTimer; - bool disabled; + bool m_disabled; #ifdef KDECONNECT_MDNS MdnsDiscovery m_mdnsDiscovery; diff --git a/core/daemon.cpp b/core/daemon.cpp index 580fcf458..fe6c82e09 100644 --- a/core/daemon.cpp +++ b/core/daemon.cpp @@ -157,7 +157,7 @@ QStringList Daemon::linkProviders() const QStringList returnValue; for (LinkProvider *a : std::as_const(d->m_linkProviders)) { - QString line = QString(a->name()); + QString line(a->name()); if (status[QStringLiteral("enabled")].contains(a->name())) { line += QStringLiteral("|enabled"); @@ -184,7 +184,7 @@ void Daemon::setProviderStatus(const QStringList &providerStatus) QString providerName = components.at(0); QString providerStatus = components.at(1); - auto linkProviders = this->getLinkProviders(); + const auto linkProviders = this->getLinkProviders(); for (LinkProvider *provider : linkProviders) { if (provider->name() == providerName) { if (providerStatus == QStringLiteral("enabled")) { diff --git a/core/kdeconnectconfig.cpp b/core/kdeconnectconfig.cpp index e853ebbcf..b222ba909 100644 --- a/core/kdeconnectconfig.cpp +++ b/core/kdeconnectconfig.cpp @@ -85,8 +85,10 @@ void KdeConnectConfig::setLinkProviderStatus(const QStringList enabledProviders, QMap KdeConnectConfig::linkProviderStatus() const { - return {{QStringLiteral("enabled"), d->m_config->value(QStringLiteral("enabled_providers")).toStringList()}, - {QStringLiteral("disabled"), d->m_config->value(QStringLiteral("disabled_providers")).toStringList()}}; + return { + {QStringLiteral("enabled"), d->m_config->value(QStringLiteral("enabled_providers")).toStringList()}, + {QStringLiteral("disabled"), d->m_config->value(QStringLiteral("disabled_providers")).toStringList()}, + }; } DeviceType KdeConnectConfig::deviceType()