]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Make folder migration in FolderMan::setupFolders() less unreadable, constify
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 26 Apr 2023 08:01:33 +0000 (16:01 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 8 May 2023 14:56:33 +0000 (22:56 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/folderman.cpp

index 655c1c0b6278306dbaedbd11d02f99868d6fbe91..f2670f4a459d609892dd830772f310021e27e3e0 100644 (file)
@@ -178,11 +178,11 @@ int FolderMan::setupFolders()
     auto settings = ConfigFile::settingsWithGroup(QLatin1String("Accounts"));
     const auto accountsWithSettings = settings->childGroups();
     if (accountsWithSettings.isEmpty()) {
-        int r = setupFoldersMigration();
-        if (r > 0) {
+        const auto migratedFoldersCount = setupFoldersMigration();
+        if (migratedFoldersCount > 0) {
             AccountManager::instance()->save(false); // don't save credentials, they had not been loaded from keychain
         }
-        return r;
+        return migratedFoldersCount;
     }
 
     qCInfo(lcFolderMan) << "Setup folders from settings file";
@@ -197,7 +197,7 @@ int FolderMan::setupFolders()
 
         // The "backwardsCompatible" flag here is related to migrating old
         // database locations
-        auto process = [&](const QString &groupName, bool backwardsCompatible, bool foldersWithPlaceholders) {
+        auto process = [&](const QString &groupName, const bool backwardsCompatible, const bool foldersWithPlaceholders) {
             settings->beginGroup(groupName);
             if (skipSettingsKeys.contains(settings->group())) {
                 // Should not happen: bad container keys should have been deleted