[Pkg-owncloud-commits] [owncloud-client] 297/498: Wizard: show an error if the folder already exists

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit aabad22cefc2659b449b073945337eb638a95341
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Jul 13 15:37:01 2015 +0200

    Wizard: show an error if the folder already exists
    
    Issue #3444
---
 src/gui/wizard/owncloudadvancedsetuppage.cpp | 9 ++++++++-
 src/gui/wizard/owncloudadvancedsetuppage.h   | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp
index 0369c63..5253e91 100644
--- a/src/gui/wizard/owncloudadvancedsetuppage.cpp
+++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp
@@ -27,6 +27,7 @@
 #include "theme.h"
 #include "configfile.h"
 #include "selectivesyncdialog.h"
+#include <folderman.h>
 #include "creds/abstractcredentials.h"
 #include "networkjobs.h"
 
@@ -38,6 +39,7 @@ OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
     _ui(),
     _checking(false),
     _created(false),
+    _localFolderValid(false),
     _progressIndi(new QProgressIndicator (this)),
     _oldLocalFolder(),
     _remoteFolder()
@@ -86,7 +88,7 @@ void OwncloudAdvancedSetupPage::setupCustomization()
 
 bool OwncloudAdvancedSetupPage::isComplete() const
 {
-    return !_checking;
+    return !_checking && _localFolderValid;
 }
 
 void OwncloudAdvancedSetupPage::initializePage()
@@ -124,6 +126,9 @@ void OwncloudAdvancedSetupPage::updateStatus()
 {
     const QString locFolder = localFolder();
     // check if the local folder exists. If so, and if its not empty, show a warning.
+    QString errorStr = FolderMan::instance()->checkPathValidityForNewFolder(locFolder);
+    _localFolderValid = errorStr.isEmpty();
+
     QString t;
 
     _ui.pbSelectLocalFolder->setText(QDir::toNativeSeparators(locFolder));
@@ -150,6 +155,8 @@ void OwncloudAdvancedSetupPage::updateStatus()
     _ui.syncModeLabel->setText(t);
     _ui.syncModeLabel->setFixedHeight(_ui.syncModeLabel->sizeHint().height());
     wizard()->resize(wizard()->sizeHint());
+    setErrorString(errorStr);
+    emit completeChanged();
 }
 
 /* obsolete */
diff --git a/src/gui/wizard/owncloudadvancedsetuppage.h b/src/gui/wizard/owncloudadvancedsetuppage.h
index 2ccc9a1..6b41477 100644
--- a/src/gui/wizard/owncloudadvancedsetuppage.h
+++ b/src/gui/wizard/owncloudadvancedsetuppage.h
@@ -67,6 +67,7 @@ private:
   Ui_OwncloudAdvancedSetupPage _ui;
   bool _checking;
   bool _created;
+  bool _localFolderValid;
   QProgressIndicator* _progressIndi;
   QString _oldLocalFolder;
   QString _remoteFolder;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list