diff options
author | allexzander <blackslayer4@gmail.com> | 2021-01-29 21:00:21 +0300 |
---|---|---|
committer | allexzander <blackslayer4@gmail.com> | 2021-02-04 11:05:18 +0300 |
commit | 81a090b362f10df8d208924c97148b0bcff135ad (patch) | |
tree | c6466fd57619bafbbafa68b48c494ab07b0e307b /src/gui/folderstatusmodel.cpp | |
parent | 93b26bc666523d245b323c03567f81f7f7687ccb (diff) |
Allow creation of new folders from the Settings Dialog.
Signed-off-by: allexzander <blackslayer4@gmail.com>
Diffstat (limited to 'src/gui/folderstatusmodel.cpp')
-rw-r--r-- | src/gui/folderstatusmodel.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index d2e906c0e..d66378a16 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -595,8 +595,12 @@ void FolderStatusModel::fetchMore(const QModelIndex &parent) return; info->resetSubs(this, parent); QString path = info->_folder->remotePathTrailingSlash(); - if (info->_path != QLatin1String("/")) { - path += info->_path; + + // info->_path always contains non-mangled name, so we need to use mangled when requesting nested folders for encrypted subfolders as required by LsColJob + const QString infoPath = (info->_isEncrypted && !info->_e2eMangledName.isEmpty()) ? info->_e2eMangledName : info->_path; + + if (infoPath != QLatin1String("/")) { + path += infoPath; } auto *job = new LsColJob(_accountState->account(), path, this); @@ -742,6 +746,15 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list) parentInfo->_folder->journalDb()->getFileRecordByE2eMangledName(removeTrailingSlash(relativePath), &rec); if (rec.isValid()) { newInfo._name = removeTrailingSlash(rec._path).split('/').last(); + if (rec._isE2eEncrypted && !rec._e2eMangledName.isEmpty()) { + // we must use local path for Settings Dialog's filesystem tree, otherwise open and create new folder actions won't work + // hence, we are storing _e2eMangledName separately so it can be use later for LsColJob + newInfo._e2eMangledName = relativePath; + newInfo._path = rec._path; + } + if (!newInfo._path.endsWith('/')) { + newInfo._path += '/'; + } } else { newInfo._name = removeTrailingSlash(relativePath).split('/').last(); } |