Ensure the url is complete before we validate it

Fixes: #6722
This commit is contained in:
Hannah von Reth 2019-09-25 13:45:20 +02:00 committed by Kevin Ottens
parent c9476a11f4
commit dc55617144
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2

View file

@ -199,9 +199,9 @@ void OwncloudSetupPage::slotUrlEditFinished()
if (QUrl(url).isRelative() && !url.isEmpty()) { if (QUrl(url).isRelative() && !url.isEmpty()) {
// no scheme defined, set one // no scheme defined, set one
url.prepend("https://"); url.prepend("https://");
}
_ui.leUrl->setFullText(url); _ui.leUrl->setFullText(url);
} }
}
bool OwncloudSetupPage::isComplete() const bool OwncloudSetupPage::isComplete() const
{ {
@ -265,6 +265,7 @@ QString OwncloudSetupPage::url() const
bool OwncloudSetupPage::validatePage() bool OwncloudSetupPage::validatePage()
{ {
if (!_authTypeKnown) { if (!_authTypeKnown) {
slotUrlEditFinished();
QString u = url(); QString u = url();
QUrl qurl(u); QUrl qurl(u);
if (!qurl.isValid() || qurl.host().isEmpty()) { if (!qurl.isValid() || qurl.host().isEmpty()) {