1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 04:36:34 +01:00

[WebView] Edit isValidUrl method. All non-empty urls are valid now.

Fixes #1099
This commit is contained in:
nowrep 2013-12-05 19:18:11 +01:00
parent 43ab2e44f0
commit 5a7789bd17

View File

@ -239,21 +239,8 @@ QWebElement WebView::activeElement() const
bool WebView::isUrlValid(const QUrl &url)
{
const QString &urlScheme = url.scheme();
if (urlScheme == QLatin1String("data") || urlScheme == QLatin1String("qrc") ||
urlScheme == QLatin1String("mailto")) {
return true;
}
if (urlScheme == QLatin1String("qupzilla") || urlScheme == QLatin1String("file")) {
return !url.path().isEmpty();
}
if (url.isValid() && !url.host().isEmpty() && !urlScheme.isEmpty()) {
return true;
}
return false;
// Valid url must have scheme and actually contains something (so scheme:// is invalid)
return url.isValid() && !url.scheme().isEmpty() && (!url.host().isEmpty() || !url.path().isEmpty());
}
QUrl WebView::guessUrlFromString(const QString &string)