Wizard: Do not start from scratch if the initial folder is non-default

Before, the folder was initialized to "ownCloud" in any case,
which lead the wizard to conclude it had to sync everything anew,
because the location moved -- even if the folder location was manually
corrected.

Fixes parts of #1172
This commit is contained in:
Daniel Molkentin 2013-11-26 00:00:27 +01:00
parent fa715ce135
commit 050bb55f1e

View file

@ -77,6 +77,8 @@ void OwncloudSetupWizard::runWizard(QObject* obj, const char* amember, QWidget *
void OwncloudSetupWizard::startWizard()
{
FolderMan *folderMan = FolderMan::instance();
bool multiFolderSetup = folderMan->map().count() > 1;
// ###
Account *account = Account::restore();
if (!account) {
@ -96,9 +98,19 @@ void OwncloudSetupWizard::startWizard()
QString localFolder = Theme::instance()->defaultClientFolder();
// if its a relative path, prepend with users home dir, otherwise use as absolute path
if( !QDir(localFolder).isAbsolute() ) {
localFolder = QDir::homePath() + QDir::separator() + localFolder;
}
if (!multiFolderSetup) {
QList<Folder*> folders = folderMan->map().values();
if (!folders.isEmpty()) {
Folder* folder = folders.first();
localFolder = QDir(folder->path()).absolutePath();
}
}
_ocWizard->setProperty("localFolder", localFolder);
_ocWizard->setRemoteFolder(_remoteFolder);
@ -107,7 +119,7 @@ void OwncloudSetupWizard::startWizard()
_ocWizard->restart();
// settings re-initialized in initPage must be set here after restart
_ocWizard->setMultipleFoldersExist(FolderMan::instance()->map().count() > 1);
_ocWizard->setMultipleFoldersExist( multiFolderSetup );
_ocWizard->open();
_ocWizard->raise();