// Wipe selective sync blacklist
bool ok = false;
- auto oldBlacklist = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
+ const auto oldBlacklist = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, {});
// Change the folder vfs mode and load the plugin
bool ok = false;
const auto undecidedList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, &ok);
- QString p;
for (const auto &it : undecidedList) {
// FIXME: add the folder alias in a hoover hint.
// folder->alias() + QLatin1String("/")
_instance = nullptr;
}
-OCC::Folder::Map FolderMan::map()
+const OCC::Folder::Map &FolderMan::map() const
{
return _folderMap;
}
*/
static void backwardMigrationSettingsKeys(QStringList *deleteKeys, QStringList *ignoreKeys);
- OCC::Folder::Map map();
+ const Folder::Map &map() const;
/** Adds a folder for an account, ensures the journal is gone and saves it in the settings.
*/
void FolderStatusModel::slotApplySelectiveSync()
{
- for (int i = 0; i < _folders.count(); ++i) {
- if (!_folders[i]._fetched) {
- _folders[i]._folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, QStringList());
+ for (const auto &folderInfo : qAsConst(_folders)) {
+ if (!folderInfo._fetched) {
+ folderInfo._folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, QStringList());
continue;
}
- auto folder = _folders.at(i)._folder;
+ const auto folder = folderInfo._folder;
bool ok = false;
auto oldBlackList = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, &ok);
qCWarning(lcFolderStatus) << "Could not read selective sync list from db.";
continue;
}
- QStringList blackList = createBlackList(_folders.at(i), oldBlackList);
+ QStringList blackList = createBlackList(folderInfo, oldBlackList);
folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blackList);
auto blackListSet = blackList.toSet();
QString OCC::FolderMan::escapeAlias(QString const&){ return QString(); }
void OCC::FolderMan::scheduleFolder(OCC::Folder*){ }
OCC::SocketApi *OCC::FolderMan::socketApi(){ return new SocketApi; }
-OCC::Folder::Map OCC::FolderMan::map() { return OCC::Folder::Map(); }
+const OCC::Folder::Map &OCC::FolderMan::map() const { return OCC::Folder::Map(); }
void OCC::FolderMan::setSyncEnabled(bool) { }
void OCC::FolderMan::slotSyncOnceFileUnlocks(QString const&) { }
void OCC::FolderMan::slotScheduleETagJob(QString const&, OCC::RequestEtagJob*){ }