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 <daniel@molkentin.de>2012-09-14 12:29:53 +0400
committerDaniel Molkentin <daniel@molkentin.de>2012-09-14 12:29:53 +0400
commit55e1ef2cc563396fa828177f10428817b6441038 (patch)
tree08a3de9e8c417e34b0ef28e1b18cd3c53546d01a
parent5ecab55781e22d0e1a0b5e685949f02a496b0514 (diff)
parent4dbd8ee016597e392174906b5ae1c0ce2459cdde (diff)
Merge pull request #3 from kyle-f/master
Owncloud client wizard setup page doesn't handle back button presses.
-rw-r--r--src/mirall/owncloudwizard.cpp18
-rw-r--r--src/mirall/owncloudwizard.h3
2 files changed, 19 insertions, 2 deletions
diff --git a/src/mirall/owncloudwizard.cpp b/src/mirall/owncloudwizard.cpp
index 3a9e18d14..7005c2d9e 100644
--- a/src/mirall/owncloudwizard.cpp
+++ b/src/mirall/owncloudwizard.cpp
@@ -57,6 +57,9 @@ void setupCustomMedia( QVariant variant, QLabel *label )
OwncloudSetupPage::OwncloudSetupPage()
{
_ui.setupUi(this);
+
+ connect(_ui.leUrl, SIGNAL(textChanged(QString)), SLOT(handleNewOcUrl(QString)));
+
registerField( QLatin1String("OCUrl"), _ui.leUrl );
registerField( QLatin1String("OCUser"), _ui.leUsername );
registerField( QLatin1String("OCPasswd"), _ui.lePassword);
@@ -147,6 +150,21 @@ void OwncloudSetupPage::slotSecureConChanged( int state )
}
}
+void OwncloudSetupPage::handleNewOcUrl(const QString& ocUrl)
+{
+ QUrl url(ocUrl);
+
+ QString urlMinusScheme = url.toString(QUrl::RemoveScheme);
+
+ // QUrl::RemoveScheme leaves the beginning slashes. Remove them
+ // if they're present.
+ if (urlMinusScheme.startsWith("//")) {
+ urlMinusScheme.remove(0, 2);
+ }
+
+ _ui.leUrl->setText(urlMinusScheme);
+}
+
bool OwncloudSetupPage::isComplete() const
{
if( _ui.leUrl->text().isEmpty() ) return false;
diff --git a/src/mirall/owncloudwizard.h b/src/mirall/owncloudwizard.h
index d0427c0bf..35bc7ba1d 100644
--- a/src/mirall/owncloudwizard.h
+++ b/src/mirall/owncloudwizard.h
@@ -45,10 +45,10 @@ public:
protected slots:
void slotPwdStoreChanged( int );
void slotSecureConChanged( int );
+ void handleNewOcUrl(const QString& ocUrl);
void setupCustomization();
private:
Ui_OwncloudSetupPage _ui;
-
};
class OwncloudWizard: public QWizard
@@ -112,7 +112,6 @@ public:
private:
Ui_OwncloudWizardSelectTypePage _ui;
-
};
class CreateAnOwncloudPage: public QWizardPage