Commit 93c0763e authored by Àlex Fiestas's avatar Àlex Fiestas
Browse files

Emit a description in filetransferjob

This basically allows Plasma (or any other job trakcer) to show
a nice description showing FROM and TO, kinda:

From: Nexus5
To: ~/afiestas/Downloads/foo.mkv
parent 3b276855
......@@ -37,6 +37,7 @@ FileTransferJob::FileTransferJob(const QSharedPointer<QIODevice>& origin, int si
mOrigin = origin;
mSize = size;
mWritten = 0;
mDeviceName = i18nc("Device name that will appear on the jobs", "KDE-Connect");
kDebug(kdeconnect_kded()) << "FileTransferJob Downloading payload to" << destination;
......@@ -49,6 +50,10 @@ void FileTransferJob::start()
//kDebug(kdeconnect_kded()) << "FileTransferJob start";
description(this, i18n("Receiving file over KDE-Connect"),
QPair<QString, QString>(i18nc("File transfer origin", "From"),
QPair<QString, QString>(i18nc("File transfer destination", "To"), mDestination->url().path()));
//Open destination file
......@@ -40,6 +40,7 @@ public:
virtual void start();
KUrl destination() { return mDestination->url(); }
void setDeviceName(const QString &deviceName) {mDeviceName = deviceName;};
public Q_SLOTS:
void readyRead();
void open(KIO::Job*);
......@@ -49,6 +50,7 @@ public Q_SLOTS:
QSharedPointer<QIODevice> mOrigin;
KIO::FileJob* mDestination;
QString mDeviceName;
int mSize;
int mWritten;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment