From 90db41def103ee2d743234a2e1c1d1832650cfc1 Mon Sep 17 00:00:00 2001 From: alex-z Date: Tue, 14 Nov 2023 19:18:01 +0100 Subject: [PATCH 1/2] VFS. Properly set Folders/WithPlaceholders in config when switching modes. Refactoring. Signed-off-by: alex-z --- src/gui/folder.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index dc37d71d18893..21f3423460326 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -767,11 +767,11 @@ void Folder::implicitlyHydrateFile(const QString &relativepath) void Folder::setVirtualFilesEnabled(bool enabled) { - Vfs::Mode newMode = _definition.virtualFilesMode; - if (enabled && _definition.virtualFilesMode == Vfs::Off) { - newMode = bestAvailableVfsMode(); - } else if (!enabled && _definition.virtualFilesMode != Vfs::Off) { + auto newMode = _definition.virtualFilesMode; + if (!enabled) { newMode = Vfs::Off; + } else if (newMode == Vfs::Off) { + newMode = bestAvailableVfsMode(); } if (newMode != _definition.virtualFilesMode) { @@ -788,8 +788,8 @@ void Folder::setVirtualFilesEnabled(bool enabled) _definition.virtualFilesMode = newMode; startVfs(); + _saveInFoldersWithPlaceholders = newMode != Vfs::Off; if (newMode != Vfs::Off) { - _saveInFoldersWithPlaceholders = true; switchToVirtualFiles(); } saveToSettings(); From 8dfc3bcc053767a873ec2085907b5549c25f5532 Mon Sep 17 00:00:00 2001 From: alex-z Date: Tue, 14 Nov 2023 19:20:51 +0100 Subject: [PATCH 2/2] Folders. Fix incorrect alias concatenation. Avoids leading zero. Signed-off-by: alex-z --- src/gui/folderman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 708b81358024d..551abde93a061 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -1223,7 +1223,7 @@ Folder *FolderMan::addFolderInternal( || _folderMap.contains(folderDefinition.alias) || _additionalBlockedFolderAliases.contains(folderDefinition.alias)) { // There is already a folder configured with this name and folder names need to be unique - folderDefinition.alias = alias + QString::number(++count); + folderDefinition.alias = QString::number(alias.toInt() + (++count)); } auto folder = new Folder(folderDefinition, accountState, std::move(vfs), this);