mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
[LocationBar] Don't incorrectly show about to be loaded url when it was not accepted
It can happen for example when trying to change address on a page that handles window.onbeforeunload event
This commit is contained in:
parent
28091f4957
commit
4e8c0adbad
@ -185,6 +185,11 @@ QUrl LocationBar::createUrl()
|
|||||||
|
|
||||||
QString LocationBar::convertUrlToText(const QUrl &url) const
|
QString LocationBar::convertUrlToText(const QUrl &url) const
|
||||||
{
|
{
|
||||||
|
// It was most probably entered by user, so don't urlencode it
|
||||||
|
if (url.scheme().isEmpty()) {
|
||||||
|
return url.toString();
|
||||||
|
}
|
||||||
|
|
||||||
QString stringUrl = QzTools::urlEncodeQueryString(url);
|
QString stringUrl = QzTools::urlEncodeQueryString(url);
|
||||||
|
|
||||||
if (stringUrl == QLatin1String("qupzilla:speeddial") || stringUrl == QLatin1String("about:blank")) {
|
if (stringUrl == QLatin1String("qupzilla:speeddial") || stringUrl == QLatin1String("about:blank")) {
|
||||||
|
@ -191,7 +191,6 @@ void WebView::load(const QNetworkRequest &request, QNetworkAccessManager::Operat
|
|||||||
|
|
||||||
if (reqUrl.isEmpty() || isUrlValid(reqUrl)) {
|
if (reqUrl.isEmpty() || isUrlValid(reqUrl)) {
|
||||||
QWebView::load(request, operation, body);
|
QWebView::load(request, operation, body);
|
||||||
emit urlChanged(reqUrl);
|
|
||||||
m_aboutToLoadUrl = reqUrl;
|
m_aboutToLoadUrl = reqUrl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -200,8 +199,6 @@ void WebView::load(const QNetworkRequest &request, QNetworkAccessManager::Operat
|
|||||||
const QUrl searchUrl = res.request.url();
|
const QUrl searchUrl = res.request.url();
|
||||||
|
|
||||||
QWebView::load(res.request, res.operation, res.data);
|
QWebView::load(res.request, res.operation, res.data);
|
||||||
|
|
||||||
emit urlChanged(searchUrl);
|
|
||||||
m_aboutToLoadUrl = searchUrl;
|
m_aboutToLoadUrl = searchUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user