From 2c2e8832880eee90fb7a67051dfcd6daeca49d35 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 26 Jun 2021 14:38:01 +0200 Subject: [PATCH] Don't use KIO::AccessManager The main thing it provides over QNetworkAccessManager is integration with the CookieJar and using kio-http, but since we jsut exchange bytes from another local device that's not interesting for us --- core/daemon.h | 2 +- daemon/kdeconnectd.cpp | 8 -------- tests/testdaemon.h | 18 ------------------ 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/core/daemon.h b/core/daemon.h index ef1b17565..f33caa017 100644 --- a/core/daemon.h +++ b/core/daemon.h @@ -39,7 +39,7 @@ public: virtual void askPairingConfirmation(Device *device) = 0; virtual void reportError(const QString &title, const QString &description) = 0; virtual void quit() = 0; - virtual QNetworkAccessManager *networkAccessManager(); + QNetworkAccessManager *networkAccessManager(); virtual KJobTrackerInterface *jobTracker() = 0; Device *getDevice(const QString &deviceId); diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index fdb3a8add..887d23992 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -73,14 +73,6 @@ public: KNotification::event(KNotification::Error, title, description); } - QNetworkAccessManager *networkAccessManager() override - { - if (!m_nam) { - m_nam = new KIO::Integration::AccessManager(this); - } - return m_nam; - } - KJobTrackerInterface *jobTracker() override { return KIO::getJobTracker(); diff --git a/tests/testdaemon.h b/tests/testdaemon.h index 3e89bc92e..886fa5dee 100644 --- a/tests/testdaemon.h +++ b/tests/testdaemon.h @@ -13,12 +13,6 @@ #include #include -#ifdef HAVE_KIO -#include -#else -#include -#endif - class TestDaemon : public Daemon { public: @@ -47,18 +41,6 @@ public: d->acceptPairing(); } - QNetworkAccessManager *networkAccessManager() override - { - if (!m_nam) { -#ifdef HAVE_KIO - m_nam = new KIO::Integration::AccessManager(this); -#else - m_nam = new QNetworkAccessManager(this); -#endif - } - return m_nam; - } - Q_SCRIPTABLE virtual void sendSimpleNotification(const QString &eventId, const QString &title, const QString &text, const QString &iconName) override { qDebug() << eventId << title << text << iconName;