mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Wizard: Prepend 'https://' if no scheme is set
First part of fix for #1356
This commit is contained in:
parent
2780dae569
commit
9b9b62d4e3
2 changed files with 12 additions and 0 deletions
|
@ -51,6 +51,7 @@ OwncloudSetupPage::OwncloudSetupPage()
|
|||
setupCustomization();
|
||||
|
||||
connect(_ui.leUrl, SIGNAL(textChanged(QString)), SLOT(slotUrlChanged(QString)));
|
||||
connect(_ui.leUrl, SIGNAL(editingFinished()), SLOT(slotUrlEditFinished()));
|
||||
}
|
||||
|
||||
void OwncloudSetupPage::setServerUrl( const QString& newUrl )
|
||||
|
@ -108,6 +109,16 @@ void OwncloudSetupPage::slotUrlChanged(const QString& url)
|
|||
}
|
||||
}
|
||||
|
||||
void OwncloudSetupPage::slotUrlEditFinished()
|
||||
{
|
||||
QString url = _ui.leUrl->text();
|
||||
if (QUrl(url).isRelative()) {
|
||||
// no scheme defined, set one
|
||||
url.prepend("https://");
|
||||
}
|
||||
_ui.leUrl->setText(url);
|
||||
}
|
||||
|
||||
bool OwncloudSetupPage::isComplete() const
|
||||
{
|
||||
return !_ui.leUrl->text().isEmpty() && !_checking;
|
||||
|
|
|
@ -53,6 +53,7 @@ public slots:
|
|||
|
||||
protected slots:
|
||||
void slotUrlChanged(const QString&);
|
||||
void slotUrlEditFinished();
|
||||
|
||||
void setupCustomization();
|
||||
|
||||
|
|
Loading…
Reference in a new issue