Fix usePlaceholders migration

This commit is contained in:
Hannah von Reth 2020-11-16 15:18:22 +01:00 committed by Kevin Ottens
parent 58bc9e837c
commit 0eb8b01f0a
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2
2 changed files with 10 additions and 10 deletions

View file

@ -122,8 +122,8 @@ Folder::Folder(const FolderDefinition &definition,
// Potentially upgrade suffix vfs to windows vfs
ENFORCE(_vfs);
if (_definition.virtualFilesMode == Vfs::WithSuffix
&& _definition.upgradeVfsMode
&& isVfsPluginAvailable(Vfs::WindowsCfApi)) {
&& _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);
@ -131,9 +131,10 @@ Folder::Folder(const FolderDefinition &definition,
// Then switch to winvfs mode
_vfs.reset(winvfs.release());
_definition.virtualFilesMode = Vfs::WindowsCfApi;
saveToSettings();
}
}
saveToSettings();
}
// Initialize the vfs plugin
startVfs();

View file

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