Implement virtual KJob::doKill in FileTransferJob

This basically allows killing the job from the JobTrakcer
aka Plasma.
This commit is contained in:
Àlex Fiestas 2014-03-03 22:34:03 +01:00
parent a75bfe5f0d
commit e4c3e8c4cd
2 changed files with 12 additions and 0 deletions

View file

@ -201,3 +201,13 @@ void FileTransferJob::sourceFinished()
emitResult(); emitResult();
} }
bool FileTransferJob::doKill()
{
if (mDestinationJob) {
mDestinationJob->close();
}
if (mOrigin) {
mOrigin->close();
}
return true;
}

View file

@ -50,6 +50,8 @@ public Q_SLOTS:
void sourceFinished(); void sourceFinished();
void openFinished(KJob*); void openFinished(KJob*);
protected:
virtual bool doKill();
private: private:
void startTransfer(); void startTransfer();
QSharedPointer<QIODevice> mOrigin; QSharedPointer<QIODevice> mOrigin;