SSH: Fix non-session based download operation

Apparently this one never worked, but as we don't use it in our own
code, that went unnoticed.

Fixes: QTCREATORBUG-25236
Change-Id: Ia013baf3ca2fd01cc14b72d9c6a5f73426539d00
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-01-14 18:00:52 +01:00
parent 8526c7de77
commit a42d252054
2 changed files with 56 additions and 23 deletions

View File

@@ -154,7 +154,7 @@ void SftpTransfer::doStart()
batchFile.write("-mkdir " + QtcProcess::quoteArgUnix(dir).toLocal8Bit() + '\n');
break;
case Internal::FileTransferType::Download:
if (!QDir::root().mkdir(dir)) {
if (!QDir::root().mkpath(dir)) {
emitError(tr("Failed to create local directory \"%1\".")
.arg(QDir::toNativeSeparators(dir)));
return;
@@ -163,7 +163,7 @@ void SftpTransfer::doStart()
}
}
for (const FileToTransfer &f : d->files) {
QString sourceFileOrLinkTarget;
QString sourceFileOrLinkTarget = f.sourceFile;
bool link = false;
if (d->transferType == Internal::FileTransferType::Upload) {
QFileInfo fi(f.sourceFile);
@@ -172,8 +172,6 @@ void SftpTransfer::doStart()
batchFile.write("-rm " + QtcProcess::quoteArgUnix(f.targetFile).toLocal8Bit()
+ '\n');
sourceFileOrLinkTarget = fi.dir().relativeFilePath(fi.symLinkTarget()); // see QTBUG-5817.
} else {
sourceFileOrLinkTarget = f.sourceFile;
}
}
batchFile.write(d->transferCommand(link) + ' '