diff options
author | Christian Kamm <mail@ckamm.de> | 2019-01-25 09:46:16 +0300 |
---|---|---|
committer | Kevin Ottens <kevin.ottens@nextcloud.com> | 2020-12-15 12:58:39 +0300 |
commit | 0eb406519735c2bc3825a2d7c4c617578669bc7e (patch) | |
tree | 8af33925492891cf64bd7a193e424d629214d9a2 /src/gui/folder.cpp | |
parent | 41f1ddb5fc96b16efe752b04d63d545e421429cc (diff) |
Folder: Add remoteFolderTrailingSlash()
There were cases where the "/" exception wasn't handled correctly
and there'd be extra slashes in generated paths.
Diffstat (limited to 'src/gui/folder.cpp')
-rw-r--r-- | src/gui/folder.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 8674068e3..9828a495c 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -256,6 +256,14 @@ QString Folder::remotePath() const return _definition.targetPath; } +QString Folder::remotePathTrailingSlash() const +{ + QString result = remotePath(); + if (!result.endsWith('/')) + result.append('/'); + return result; +} + QUrl Folder::remoteUrl() const { return Utility::concatUrlPath(_accountState->account()->davUrl(), remotePath()); @@ -476,7 +484,7 @@ void Folder::startVfs() VfsSetupParams vfsParams; vfsParams.filesystemPath = path(); - vfsParams.remotePath = remotePath(); + vfsParams.remotePath = remotePathTrailingSlash(); vfsParams.account = _accountState->account(); vfsParams.journal = &_journal; vfsParams.providerName = Theme::instance()->appNameGUI(); @@ -1303,7 +1311,7 @@ bool FolderDefinition::load(QSettings &settings, const QString &alias, } // Old settings can contain paths with native separators. In the rest of the - // code we assum /, so clean it up now. + // code we assume /, so clean it up now. folder->localPath = prepareLocalPath(folder->localPath); // Target paths also have a convention |