From 46dd0c59da286fb9f3e5c00c5b5e213033fea536 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Thu, 22 Jun 2023 23:46:44 +0200 Subject: [PATCH] Remove unused priority() method --- core/backends/bluetooth/bluetoothlinkprovider.h | 4 ---- core/backends/lan/lanlinkprovider.h | 4 ---- core/backends/linkprovider.h | 5 ----- core/backends/loopback/loopbacklinkprovider.h | 4 ---- core/device.cpp | 7 ------- 5 files changed, 24 deletions(-) diff --git a/core/backends/bluetooth/bluetoothlinkprovider.h b/core/backends/bluetooth/bluetoothlinkprovider.h index edc506ead..ddedd963c 100644 --- a/core/backends/bluetooth/bluetoothlinkprovider.h +++ b/core/backends/bluetooth/bluetoothlinkprovider.h @@ -36,10 +36,6 @@ public: { return QStringLiteral("BluetoothLinkProvider"); } - int priority() override - { - return PRIORITY_MEDIUM; - } public Q_SLOTS: virtual void onNetworkChange() override; diff --git a/core/backends/lan/lanlinkprovider.h b/core/backends/lan/lanlinkprovider.h index 4ac0bb5d6..31064f889 100644 --- a/core/backends/lan/lanlinkprovider.h +++ b/core/backends/lan/lanlinkprovider.h @@ -36,10 +36,6 @@ public: { return QStringLiteral("LanLinkProvider"); } - int priority() override - { - return PRIORITY_HIGH; - } static void configureSslSocket(QSslSocket *socket, const QString &deviceId, bool isDeviceTrusted); static void configureSocket(QSslSocket *socket); diff --git a/core/backends/linkprovider.h b/core/backends/linkprovider.h index 6a971592d..2088dbded 100644 --- a/core/backends/linkprovider.h +++ b/core/backends/linkprovider.h @@ -19,15 +19,10 @@ class KDECONNECTCORE_EXPORT LinkProvider : public QObject Q_OBJECT public: - const static int PRIORITY_LOW = 0; // eg: 3g internet - const static int PRIORITY_MEDIUM = 50; // eg: internet - const static int PRIORITY_HIGH = 100; // eg: lan - LinkProvider(); ~LinkProvider() override = default; virtual QString name() = 0; - virtual int priority() = 0; public Q_SLOTS: virtual void onStart() = 0; diff --git a/core/backends/loopback/loopbacklinkprovider.h b/core/backends/loopback/loopbacklinkprovider.h index e5f8fc035..0eb7400b1 100644 --- a/core/backends/loopback/loopbacklinkprovider.h +++ b/core/backends/loopback/loopbacklinkprovider.h @@ -22,10 +22,6 @@ public: { return QStringLiteral("LoopbackLinkProvider"); } - int priority() override - { - return PRIORITY_LOW; - } void onStart() override; void onStop() override; diff --git a/core/device.cpp b/core/device.cpp index f0c29f9e6..fb6cdec4a 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -276,11 +276,6 @@ void Device::pairingHandler_unpaired() Q_EMIT pairStateChanged(pairStateAsInt()); } -static bool lessThan(DeviceLink *p1, DeviceLink *p2) -{ - return p1->provider()->priority() > p2->provider()->priority(); -} - void Device::addLink(const NetworkPacket &identityPacket, DeviceLink *link) { // qCDebug(KDECONNECT_CORE) << "Adding link to" << id() << "via" << link->provider(); @@ -308,8 +303,6 @@ void Device::addLink(const NetworkPacket &identityPacket, DeviceLink *link) connect(link, &DeviceLink::receivedPacket, this, &Device::privateReceivedPacket); - std::sort(d->m_deviceLinks.begin(), d->m_deviceLinks.end(), lessThan); - const bool capabilitiesSupported = identityPacket.has(QStringLiteral("incomingCapabilities")) || identityPacket.has(QStringLiteral("outgoingCapabilities")); if (capabilitiesSupported) { const QSet outgoingCapabilities = identityPacket.get(QStringLiteral("outgoingCapabilities")).toSet(),