mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-25 22:05:53 +03:00
Modernise FolderMan::setupFoldersHelper, get rid of more single-letter variables
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
c2da86c653
commit
7f46084110
1 changed files with 9 additions and 10 deletions
|
@ -284,8 +284,8 @@ void FolderMan::setupFoldersHelper(QSettings &settings, AccountStatePtr account,
|
||||||
qCWarning(lcFolderMan) << "Could not load plugin for mode" << folderDefinition.virtualFilesMode;
|
qCWarning(lcFolderMan) << "Could not load plugin for mode" << folderDefinition.virtualFilesMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Folder *f = addFolderInternal(folderDefinition, account.data(), std::move(vfs));
|
const auto folder = addFolderInternal(folderDefinition, account.data(), std::move(vfs));
|
||||||
f->saveToSettings();
|
folder->saveToSettings();
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -316,26 +316,25 @@ void FolderMan::setupFoldersHelper(QSettings &settings, AccountStatePtr account,
|
||||||
qFatal("Could not load plugin");
|
qFatal("Could not load plugin");
|
||||||
}
|
}
|
||||||
|
|
||||||
Folder *f = addFolderInternal(std::move(folderDefinition), account.data(), std::move(vfs));
|
if (const auto folder = addFolderInternal(std::move(folderDefinition), account.data(), std::move(vfs))) {
|
||||||
if (f) {
|
|
||||||
if (switchToVfs) {
|
if (switchToVfs) {
|
||||||
f->switchToVirtualFiles();
|
folder->switchToVirtualFiles();
|
||||||
}
|
}
|
||||||
// Migrate the old "usePlaceholders" setting to the root folder pin state
|
// Migrate the old "usePlaceholders" setting to the root folder pin state
|
||||||
if (settings.value(QLatin1String(settingsVersionC), 1).toInt() == 1
|
if (settings.value(QLatin1String(settingsVersionC), 1).toInt() == 1
|
||||||
&& settings.value(QLatin1String("usePlaceholders"), false).toBool()) {
|
&& settings.value(QLatin1String("usePlaceholders"), false).toBool()) {
|
||||||
qCInfo(lcFolderMan) << "Migrate: From usePlaceholders to PinState::OnlineOnly";
|
qCInfo(lcFolderMan) << "Migrate: From usePlaceholders to PinState::OnlineOnly";
|
||||||
f->setRootPinState(PinState::OnlineOnly);
|
folder->setRootPinState(PinState::OnlineOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migration: Mark folders that shall be saved in a backwards-compatible way
|
// Migration: Mark folders that shall be saved in a backwards-compatible way
|
||||||
if (backwardsCompatible)
|
if (backwardsCompatible)
|
||||||
f->setSaveBackwardsCompatible(true);
|
folder->setSaveBackwardsCompatible(true);
|
||||||
if (foldersWithPlaceholders)
|
if (foldersWithPlaceholders)
|
||||||
f->setSaveInFoldersWithPlaceholders();
|
folder->setSaveInFoldersWithPlaceholders();
|
||||||
|
|
||||||
scheduleFolder(f);
|
scheduleFolder(folder);
|
||||||
emit folderSyncStateChange(f);
|
emit folderSyncStateChange(folder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
Loading…
Reference in a new issue