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
This commit is contained in:
parent
3b276855a0
commit
93c0763e63
2 changed files with 7 additions and 0 deletions
|
@ -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"),
|
||||
QString(mDeviceName)),
|
||||
QPair<QString, QString>(i18nc("File transfer destination", "To"), mDestination->url().path()));
|
||||
//Open destination file
|
||||
mDestination->start();
|
||||
}
|
||||
|
|
|
@ -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:
|
|||
private:
|
||||
QSharedPointer<QIODevice> mOrigin;
|
||||
KIO::FileJob* mDestination;
|
||||
QString mDeviceName;
|
||||
int mSize;
|
||||
int mWritten;
|
||||
|
||||
|
|
Loading…
Reference in a new issue