diff options
author | alex-z <blackslayer4@gmail.com> | 2021-12-14 13:26:11 +0300 |
---|---|---|
committer | alex-z <blackslayer4@gmail.com> | 2021-12-14 17:33:35 +0300 |
commit | 3f3b752e440547ef70b0c46c1c9b594231af9e16 (patch) | |
tree | 986af4c7cc1c649d4e80df41509c2b262f9879f4 /src | |
parent | 1244e96681c4d353ac3df8f5d66f58363139fbbd (diff) |
Save folder settings to config when force-switching VFS.
Signed-off-by: alex-z <blackslayer4@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/folder.cpp | 9 | ||||
-rw-r--r-- | src/gui/folder.h | 6 | ||||
-rw-r--r-- | src/gui/folderman.cpp | 4 |
3 files changed, 19 insertions, 0 deletions
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(); } |