aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'jobs')
-rw-r--r--jobs/downloadfilejob.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/jobs/downloadfilejob.cpp b/jobs/downloadfilejob.cpp
index 2530e259..06fa3b48 100644
--- a/jobs/downloadfilejob.cpp
+++ b/jobs/downloadfilejob.cpp
@@ -36,14 +36,15 @@ QString DownloadFileJob::targetFileName() const
void DownloadFileJob::beforeStart(const ConnectionData*)
{
- if (d->targetFile && !d->targetFile->open(QIODevice::WriteOnly))
+ if (d->targetFile && !d->targetFile->isReadable() &&
+ !d->targetFile->open(QIODevice::WriteOnly))
{
qCWarning(JOBS) << "Couldn't open the file"
<< d->targetFile->fileName() << "for writing";
setStatus(FileError, "Could not open the target file for writing");
return;
}
- if (!d->tempFile->open(QIODevice::WriteOnly))
+ if (!d->tempFile->isReadable() && !d->tempFile->open(QIODevice::WriteOnly))
{
qCWarning(JOBS) << "Couldn't open the temporary file"
<< d->tempFile->fileName() << "for writing";