mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Merge pull request #1549 from srazi/fix_1539
Assume "about:blank" as an empty URL.
This commit is contained in:
commit
478cfa660d
|
@ -336,7 +336,7 @@ void LocationBar::showUrl(const QUrl &url)
|
|||
}
|
||||
|
||||
// Set converted url as text
|
||||
setText(convertUrlToText(url));
|
||||
setText(stringUrl);
|
||||
|
||||
// Move cursor to the start
|
||||
home(false);
|
||||
|
|
|
@ -129,18 +129,30 @@ bool WebView::isTitleEmpty() const
|
|||
return QWebView::title().isEmpty();
|
||||
}
|
||||
|
||||
static QString convertUrlToText(const QUrl &url)
|
||||
{
|
||||
// It was most probably entered by user, so don't urlencode it
|
||||
if (url.scheme().isEmpty()) {
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
QString stringUrl = QzTools::urlEncodeQueryString(url);
|
||||
|
||||
if (stringUrl == QLatin1String("about:blank")) {
|
||||
stringUrl.clear();
|
||||
}
|
||||
|
||||
return stringUrl;
|
||||
}
|
||||
|
||||
QUrl WebView::url() const
|
||||
{
|
||||
QUrl returnUrl = page()->url();
|
||||
|
||||
if (returnUrl.isEmpty()) {
|
||||
if (convertUrlToText(returnUrl).isEmpty()) {
|
||||
returnUrl = m_aboutToLoadUrl;
|
||||
}
|
||||
|
||||
if (returnUrl.toString() == QLatin1String("about:blank")) {
|
||||
returnUrl = QUrl();
|
||||
}
|
||||
|
||||
return returnUrl;
|
||||
}
|
||||
|
||||
|
@ -404,7 +416,8 @@ void WebView::editDelete()
|
|||
void WebView::reload()
|
||||
{
|
||||
m_isReloading = true;
|
||||
if (QWebView::url().isEmpty() && !m_aboutToLoadUrl.isEmpty()) {
|
||||
|
||||
if (convertUrlToText(QWebView::url()).isEmpty() && !m_aboutToLoadUrl.isEmpty()) {
|
||||
load(m_aboutToLoadUrl);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user