Merging work branch for a bug fix for bug #2379.

It closes all db connections if the new local path is a already
synced folder path.
This commit is contained in:
Klaas Freitag 2014-10-24 14:43:48 +02:00
commit c12d3870cd

View File

@ -401,7 +401,6 @@ void OwncloudSetupWizard::slotAssistantFinished( int result )
_ocWizard->account()->deleteLater();
qDebug() << "Rejected the new config, use the old!";
} else if( result == QDialog::Accepted ) {
Account *newAccount = _ocWizard->account();
Account *origAccount = AccountManager::instance()->account();
@ -410,6 +409,13 @@ void OwncloudSetupWizard::slotAssistantFinished( int result )
localFolder.append(QLatin1Char('/'));
}
Folder *f = folderMan->folderForPath(localFolder);
if( f ) {
folderMan->setSyncEnabled(false);
folderMan->terminateSyncProcess(f->alias());
f->journalDb()->close();
}
bool isInitialSetup = (origAccount == 0);
// check if either the account or the local folder changed, than reinit