Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/libs/qssh/sftpchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ SftpJobId SftpChannel::downloadFile(const QString &remoteFilePath, QSharedPointe
}

SftpJobId SftpChannel::uploadDir(const QString &localDirPath,
const QString &remoteParentDirPath)
const QString &remoteParentDirPath, bool appendDirPath)
{
if (state() != Initialized)
return SftpInvalidJob;
Expand All @@ -248,8 +248,10 @@ SftpJobId SftpChannel::uploadDir(const QString &localDirPath,
return SftpInvalidJob;
const Internal::SftpUploadDir::Ptr uploadDirOp(
new Internal::SftpUploadDir(++d->m_nextJobId));
const QString remoteDirPath
= remoteParentDirPath + u'/' + localDir.dirName();
QString remoteDirPath = remoteParentDirPath;
if (appendDirPath) {
remoteDirPath += u'/' + localDir.dirName();
}
const Internal::SftpMakeDir::Ptr mkdirOp(
new Internal::SftpMakeDir(++d->m_nextJobId, remoteDirPath, uploadDirOp));
uploadDirOp->mkdirsInProgress.insert(mkdirOp,
Expand Down
4 changes: 2 additions & 2 deletions src/libs/qssh/sftpchannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ class QSSH_EXPORT SftpChannel : public QObject
/*!
* \brief Uploads a local directory (recursively) with files to the remote host
* \param localDirPath The path to an existing local directory
* \param remoteParentDirPath The remote path to upload it to, the name of the local directory will be appended to this
* \param remoteParentDirPath The remote path to upload it to, the name of the local directory will be appended to this if appendDirPath is set
* \return A unique ID identifying this job
*/
SftpJobId uploadDir(const QString &localDirPath,
const QString &remoteParentDirPath);
const QString &remoteParentDirPath, bool appendDirPath = true);

/*!
* \brief Downloads a remote directory (recursively) to a local path
Expand Down