Skip to content

Commit

Permalink
VFS. Properly set Folders/WithPlaceholders in config when switching m…
Browse files Browse the repository at this point in the history
…odes. Refactoring.

Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander committed Nov 14, 2023
1 parent d9c73f9 commit a7146f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down

0 comments on commit a7146f1

Please sign in to comment.