Handle transfer job being canceled

Set KilledJobError to indicate it was canceled by the user
to avoid a bogus "finished" notification.

Sadly, fileTransferCanceled has been removed from libQuotient
so this lambda botch checking transfer status needs to be done.
This commit is contained in:
Kai Uwe Broulik
2025-01-03 13:55:20 +01:00
parent c454a4942e
commit 7b7f4d264c
3 changed files with 30 additions and 2 deletions

View File

@@ -41,6 +41,15 @@ void FileTransferPseudoJob::fileTransferFailed(const QString &id, const QString
emitResult();
}
void FileTransferPseudoJob::fileTransferCanceled(const QString &id)
{
if (id != m_eventId) {
return;
}
setError(KJob::KilledJobError);
emitResult();
}
void FileTransferPseudoJob::start()
{
setTotalAmount(Unit::Files, 1);