Wizard: show a message when the URL is invalid

Rather than let Qt show "Host not found"

Issue #6646
This commit is contained in:
Olivier Goffart 2018-07-13 10:20:34 +02:00 committed by Camila San
parent 986cf448a9
commit 39c6196487
No known key found for this signature in database
GPG key ID: 7A4A6121E88E2AD4

View file

@ -293,12 +293,19 @@ QString OwncloudSetupPage::url() const
bool OwncloudSetupPage::validatePage() bool OwncloudSetupPage::validatePage()
{ {
if (!_authTypeKnown) { if (!_authTypeKnown) {
QString u = url();
QUrl qurl(u);
if (!qurl.isValid() || qurl.host().isEmpty()) {
setErrorString(tr("Invalid URL"), false);
return false;
}
setErrorString(QString(), false); setErrorString(QString(), false);
_checking = true; _checking = true;
startSpinner(); startSpinner();
emit completeChanged(); emit completeChanged();
emit determineAuthType(url()); emit determineAuthType(u);
return false; return false;
} else { } else {
// connecting is running // connecting is running