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