@@ -286,7 +286,16 @@ void FolderMan::setupFoldersHelper(QSettings &settings, AccountStatePtr account,
286
286
FolderDefinition folderDefinition;
287
287
settings.beginGroup (folderAlias);
288
288
if (FolderDefinition::load (settings, folderAlias, &folderDefinition)) {
289
- auto defaultJournalPath = folderDefinition.defaultJournalPath (account->account ());
289
+ const auto defaultJournalPath = [&account, folderDefinition] {
290
+ // if we would have booth the 2.9.0 file name and the lagacy file
291
+ // with the md5 infix we prefer the 2.9.0 version
292
+ const auto path = SyncJournalDb::makeDbName (folderDefinition.localPath );
293
+ if (QFileInfo::exists (QDir (folderDefinition.localPath ).filePath (path))) {
294
+ return path;
295
+ }
296
+ // legacy name
297
+ return SyncJournalDb::makeDbName (folderDefinition.localPath , account->account ()->url (), folderDefinition.targetPath , account->account ()->credentials ()->user ());
298
+ }();
290
299
291
300
// Migration: Old settings don't have journalPath
292
301
if (folderDefinition.journalPath .isEmpty ()) {
@@ -329,6 +338,9 @@ void FolderMan::setupFoldersHelper(QSettings &settings, AccountStatePtr account,
329
338
if (foldersWithPlaceholders)
330
339
f->setSaveInFoldersWithPlaceholders ();
331
340
341
+ // save possible changes from the migration
342
+ f->saveToSettings ();
343
+
332
344
scheduleFolder (f);
333
345
emit folderSyncStateChange (f);
334
346
}
@@ -1011,7 +1023,7 @@ Folder *FolderMan::addFolder(AccountState *accountState, const FolderDefinition
1011
1023
{
1012
1024
// Choose a db filename
1013
1025
auto definition = folderDefinition;
1014
- definition.journalPath = definition. defaultJournalPath (accountState-> account () );
1026
+ definition.journalPath = SyncJournalDb::makeDbName (folderDefinition. localPath );
1015
1027
1016
1028
if (!ensureJournalGone (definition.absoluteJournalPath ())) {
1017
1029
return nullptr ;
0 commit comments