diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 33a1634d9..6da7388db 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -691,6 +691,15 @@ void Folder::setRootPinState(PinState state) void Folder::switchToVirtualFiles() { SyncEngine::switchToVirtualFiles(path(), _journal, *_vfs); + _hasSwitchedToVfs = true; +} + +void Folder::processSwitchedToVirtualFiles() +{ + if (_hasSwitchedToVfs) { + _hasSwitchedToVfs = false; + saveToSettings(); + } } bool Folder::supportsSelectiveSync() const diff --git a/src/gui/folder.h b/src/gui/folder.h index 8fd8bfbbb..e18aecbfa 100644 --- a/src/gui/folder.h +++ b/src/gui/folder.h @@ -289,6 +289,8 @@ public: void switchToVirtualFiles(); + void processSwitchedToVirtualFiles(); + /** Whether this folder should show selective sync ui */ bool supportsSelectiveSync() const; @@ -500,6 +502,10 @@ private: */ bool _vfsOnOffPending = false; + /** Whether this folder has just switched to VFS or not + */ + bool _hasSwitchedToVfs = false; + /** * Watches this folder's local directory for changes. * diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 73ad0c553..a2c13597c 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -211,6 +211,10 @@ int FolderMan::setupFolders() emit folderListChanged(_folderMap); + for (const auto folder : _folderMap) { + folder->processSwitchedToVirtualFiles(); + } + return _folderMap.size(); }