From 0eb8b01f0a486680c162de5b4ca284f1be29f1ef Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 16 Nov 2020 15:18:22 +0100 Subject: [PATCH] Fix usePlaceholders migration --- src/gui/folder.cpp | 21 +++++++++++---------- src/gui/folderman.cpp | 1 - 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 403640994..376a58d60 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -122,17 +122,18 @@ Folder::Folder(const FolderDefinition &definition, // Potentially upgrade suffix vfs to windows vfs ENFORCE(_vfs); if (_definition.virtualFilesMode == Vfs::WithSuffix - && _definition.upgradeVfsMode - && isVfsPluginAvailable(Vfs::WindowsCfApi)) { - if (auto winvfs = createVfsFromPlugin(Vfs::WindowsCfApi)) { - // Wipe the existing suffix files from fs and journal - SyncEngine::wipeVirtualFiles(path(), _journal, *_vfs); - - // Then switch to winvfs mode - _vfs.reset(winvfs.release()); - _definition.virtualFilesMode = Vfs::WindowsCfApi; - saveToSettings(); + && _definition.upgradeVfsMode) { + if (isVfsPluginAvailable(Vfs::WindowsCfApi)) { + if (auto winvfs = createVfsFromPlugin(Vfs::WindowsCfApi)) { + // Wipe the existing suffix files from fs and journal + SyncEngine::wipeVirtualFiles(path(), _journal, *_vfs); + + // Then switch to winvfs mode + _vfs.reset(winvfs.release()); + _definition.virtualFilesMode = Vfs::WindowsCfApi; + } } + saveToSettings(); } // Initialize the vfs plugin diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index d7876d4d1..04d6eef60 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -299,7 +299,6 @@ void FolderMan::setupFoldersHelper(QSettings &settings, AccountStatePtr account, && settings.value(QLatin1String("usePlaceholders"), false).toBool()) { qCInfo(lcFolderMan) << "Migrate: From usePlaceholders to PinState::OnlineOnly"; f->setRootPinState(PinState::OnlineOnly); - settings.remove(QStringLiteral("usePlaceholders")); } // Migration: Mark folders that shall be saved in a backwards-compatible way -- 2.30.2