Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Molkentin <danimo@owncloud.com>2013-11-26 03:00:27 +0400
committerDaniel Molkentin <danimo@owncloud.com>2013-11-26 03:04:33 +0400
commit050bb55f1ebda6bcbdd195620051c2128b93025c (patch)
tree9665a20ce4988f08987886626dc43166eef5021b /src/mirall
parentfa715ce135cc0e93c741c44343f4b0576d4375a1 (diff)
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
Diffstat (limited to 'src/mirall')
-rw-r--r--src/mirall/owncloudsetupwizard.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mirall/owncloudsetupwizard.cpp b/src/mirall/owncloudsetupwizard.cpp
index d43d0d691..4db827e0e 100644
--- a/src/mirall/owncloudsetupwizard.cpp
+++ b/src/mirall/owncloudsetupwizard.cpp
@@ -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();