Compare commits
3 commits
master
...
work/acces
Author | SHA1 | Date | |
---|---|---|---|
|
0044f09b12 | ||
|
d05ef54b2a | ||
|
7b8003fe2c |
8 changed files with 4 additions and 39 deletions
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "compositefiletransferjob.h"
|
||||
#include "filetransferjob.h"
|
||||
#include <KJobTrackerInterface>
|
||||
#include <KLocalizedString>
|
||||
#include <core_debug.h>
|
||||
#include <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);
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <QDebug>
|
||||
#include <QFileInfo>
|
||||
#include <qalgorithms.h>
|
||||
#include <QNetworkAccessManager>
|
||||
|
||||
#include <KLocalizedString>
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <QCommandLineParser>
|
||||
#include <QDBusMessage>
|
||||
#include <QIcon>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QProcess>
|
||||
#include <QSessionManager>
|
||||
#include <QStandardPaths>
|
||||
|
@ -17,10 +16,10 @@
|
|||
|
||||
#include <KAboutData>
|
||||
#include <KDBusService>
|
||||
#include <KIO/AccessManager>
|
||||
#include <KLocalizedString>
|
||||
#include <KNotification>
|
||||
#include <KWindowSystem>
|
||||
#include <KIO/Global>
|
||||
|
||||
#include <dbushelper.h>
|
||||
|
||||
|
@ -38,7 +37,6 @@ class DesktopDaemon : public Daemon
|
|||
public:
|
||||
DesktopDaemon(QObject *parent = nullptr)
|
||||
: Daemon(parent)
|
||||
, m_nam(nullptr)
|
||||
{
|
||||
qApp->setWindowIcon(QIcon(QStringLiteral(":/icons/kdeconnect/kdeconnect.svg")));
|
||||
}
|
||||
|
@ -73,14 +71,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();
|
||||
|
@ -100,9 +90,6 @@ public:
|
|||
{
|
||||
QApplication::quit();
|
||||
}
|
||||
|
||||
private:
|
||||
QNetworkAccessManager *m_nam;
|
||||
};
|
||||
|
||||
// Copied from plasma-workspace/libkworkspace/kworkspace.cpp
|
||||
|
|
|
@ -128,7 +128,7 @@ bool SharePlugin::receivePacket(const NetworkPacket &np)
|
|||
m_compositeJob = new CompositeFileTransferJob(device()->id());
|
||||
m_compositeJob->setProperty("destUrl", destinationDir().toString());
|
||||
m_compositeJob->setProperty("immediateProgressReporting", true);
|
||||
KIO::getJobTracker()->registerJob(m_compositeJob);
|
||||
Daemon::instance()->jobTracker()->registerJob(m_compositeJob);
|
||||
}
|
||||
|
||||
FileTransferJob *job = np.createPayloadTransferJob(destination);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QSignalSpy>
|
||||
#include <QSocketNotifier>
|
||||
#include <QStandardPaths>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QSignalSpy>
|
||||
#include <QSocketNotifier>
|
||||
#include <QStandardPaths>
|
||||
|
|
|
@ -13,18 +13,11 @@
|
|||
#include <KJobTrackerInterface>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#ifdef HAVE_KIO
|
||||
#include <KIO/AccessManager>
|
||||
#else
|
||||
#include <QNetworkAccessManager>
|
||||
#endif
|
||||
|
||||
class TestDaemon : public Daemon
|
||||
{
|
||||
public:
|
||||
TestDaemon(QObject *parent = nullptr)
|
||||
: Daemon(parent, true)
|
||||
, m_nam(nullptr)
|
||||
, m_jobTrackerInterface(nullptr)
|
||||
{
|
||||
// Necessary to force the event loop to run because the test harness seems to behave differently
|
||||
|
@ -47,18 +40,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;
|
||||
|
@ -78,7 +59,6 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
QNetworkAccessManager *m_nam;
|
||||
KJobTrackerInterface *m_jobTrackerInterface;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue