Save folder settings to config when force-switching VFS.

Signed-off-by: alex-z <blackslayer4@gmail.com>
This commit is contained in:
alex-z 2021-12-14 12:26:11 +02:00
parent 1244e96681
commit 3f3b752e44
3 changed files with 19 additions and 0 deletions

View file

@ -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

View file

@ -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.
*

View file

@ -211,6 +211,10 @@ int FolderMan::setupFolders()
emit folderListChanged(_folderMap);
for (const auto folder : _folderMap) {
folder->processSwitchedToVirtualFiles();
}
return _folderMap.size();
}