Fixed: Trying to resume after a 206 HTTP status code

This commit is contained in:
kervala 2016-10-19 17:23:42 +02:00
parent 7dcfbe78f1
commit a99cb3c992
4 changed files with 12 additions and 1 deletions

View file

@ -388,9 +388,13 @@ void CDownloader::onDownloadFinished()
emit downloadDone();
}
else if (status == 206)
{
if (m_listener) m_listener->operationContinue();
}
else
{
m_listener->operationFail(tr("HTTP error: %1").arg(status));
if (m_listener) m_listener->operationFail(tr("HTTP error: %1").arg(status));
}
}
}

View file

@ -31,6 +31,7 @@ public:
virtual void operationProgress(qint64 current, const QString &filename) =0;
virtual void operationSuccess(qint64 total) =0;
virtual void operationFail(const QString &error) =0;
virtual void operationContinue() = 0;
virtual bool operationShouldStop() =0;
};

View file

@ -1264,6 +1264,11 @@ void COperationDialog::operationFail(const QString &error)
emit fail(error);
}
void COperationDialog::operationContinue()
{
emit done();
}
bool COperationDialog::operationShouldStop()
{
QMutexLocker locker(&m_abortingMutex);

View file

@ -129,6 +129,7 @@ protected:
virtual void operationProgress(qint64 current, const QString &filename);
virtual void operationSuccess(qint64 total);
virtual void operationFail(const QString &error);
virtual void operationContinue();
virtual bool operationShouldStop();