Merge pull request #1549 from srazi/fix_1539

Assume "about:blank" as an empty URL.
remotes/origin/falkon
David Rosca 11 years ago
commit 478cfa660d
  1. 2
      src/lib/navigation/locationbar.cpp
  2. 25
      src/lib/webkit/webview.cpp

@ -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…
Cancel
Save