appendPathToSelectiveSyncList(path, SyncJournalDb::SelectiveSyncBlackList);
}
+void Folder::migrateBlackListPath(const QString &legacyPath)
+{
+ if (legacyPath.startsWith(QLatin1Char('/'))) {
+ removePathFromSelectiveSyncList(legacyPath, SyncJournalDb::SelectiveSyncBlackList);
+ blacklistPath(legacyPath.mid(1));
+ }
+}
+
bool Folder::isFileExcludedAbsolute(const QString &fullPath) const
{
return _engine->excludedFiles().isExcluded(fullPath, path(), _definition.ignoreHiddenFiles);
folderDefinition.ignoreHiddenFiles = ignoreHiddenFiles;
if (const auto folder = addFolderInternal(folderDefinition, accountState, std::make_unique<VfsOff>())) {
- const auto blackList = settings.value(QLatin1String("blackList")).toStringList();
- if (!blackList.empty()) {
+ auto ok = true;
+ if (const auto legacyBlacklist = folder->journalDb()->getSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList,
+ &ok);ok && !legacyBlacklist.isEmpty()) {
+ qCInfo(lcFolderMan) << "Legacy selective sync list found:" << legacyBlacklist;
+ for(const auto &legacyFolder : legacyBlacklist) {
+ folder->migrateBlackListPath(legacyFolder);
+ }
+ } else {
+ qCInfo(lcFolderMan) << "There was a problem retriving the database selective sync for " << folder;
+ }
+
+ const auto settingLegacyBlacklist = settings.value(QLatin1String("blackList")).toStringList();
+ if (!settingLegacyBlacklist.empty()) {
//migrate settings
- folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, blackList);
+ folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncBlackList, settingLegacyBlacklist);
settings.remove(QLatin1String("blackList"));
// FIXME: If you remove this codepath, you need to provide another way to do
// this via theme.h or the normal FolderMan::setupFolders
folder->saveToSettings();
- qCInfo(lcFolderMan) << "Migrated!" << folder;
+ qCInfo(lcFolderMan) << "Migrated!" << folder->path();
settings.sync();
if (!folder) {