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
This commit is contained in:
Nicolas Fella 2021-06-26 14:38:01 +02:00 committed by Albert Vaca Cintora
parent 70e7336c2e
commit 2c2e883288
3 changed files with 1 additions and 27 deletions

View file

@ -39,7 +39,7 @@ public:
virtual void askPairingConfirmation(Device *device) = 0; virtual void askPairingConfirmation(Device *device) = 0;
virtual void reportError(const QString &title, const QString &description) = 0; virtual void reportError(const QString &title, const QString &description) = 0;
virtual void quit() = 0; virtual void quit() = 0;
virtual QNetworkAccessManager *networkAccessManager(); QNetworkAccessManager *networkAccessManager();
virtual KJobTrackerInterface *jobTracker() = 0; virtual KJobTrackerInterface *jobTracker() = 0;
Device *getDevice(const QString &deviceId); Device *getDevice(const QString &deviceId);

View file

@ -73,14 +73,6 @@ public:
KNotification::event(KNotification::Error, title, description); 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 KJobTrackerInterface *jobTracker() override
{ {
return KIO::getJobTracker(); return KIO::getJobTracker();

View file

@ -13,12 +13,6 @@
#include <KJobTrackerInterface> #include <KJobTrackerInterface>
#include <QCoreApplication> #include <QCoreApplication>
#ifdef HAVE_KIO
#include <KIO/AccessManager>
#else
#include <QNetworkAccessManager>
#endif
class TestDaemon : public Daemon class TestDaemon : public Daemon
{ {
public: public:
@ -47,18 +41,6 @@ public:
d->acceptPairing(); 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 Q_SCRIPTABLE virtual void sendSimpleNotification(const QString &eventId, const QString &title, const QString &text, const QString &iconName) override
{ {
qDebug() << eventId << title << text << iconName; qDebug() << eventId << title << text << iconName;