mirror of
https://github.com/altlinux/ALTMediaWriter.git
synced 2024-10-26 17:25:05 +03:00
don't remove downloaded file if cancelled
keep it and resume download if partal download file is present
This commit is contained in:
parent
c7489fea48
commit
5e9730ed49
@ -42,7 +42,7 @@ ImageDownload::ImageDownload(const QUrl &url_arg, const QString &filePath_arg)
|
||||
|
||||
const QString tempFilePath = filePath + ".part";
|
||||
file = new QFile(tempFilePath, this);
|
||||
file->open(QIODevice::WriteOnly);
|
||||
file->open(QIODevice::WriteOnly | QIODevice::Append);
|
||||
|
||||
startImageDownload();
|
||||
}
|
||||
@ -291,7 +291,7 @@ void ImageDownload::finish(const Result result_arg, const QString &errorString_a
|
||||
qDebug() << "Error string:" << m_errorString;
|
||||
}
|
||||
|
||||
if (m_result == ImageDownload::Success) {
|
||||
if (m_result == ImageDownload::Success || m_result == ImageDownload::Cancelled) {
|
||||
file->close();
|
||||
} else {
|
||||
file->remove();
|
||||
|
Loading…
Reference in New Issue
Block a user