1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Improved showing url in locationbar on opening tab

- when opening new tab (restoring session, restoring
  closed tab, ...), url of tab will be shown in locationbar
  immediately - not after first progress tick fires
This commit is contained in:
nowrep 2011-12-11 11:07:26 +01:00
parent df72343ee2
commit 65f4bf1a1b

View File

@ -647,7 +647,7 @@ void WebView::stop()
loadFinished(true);
if (m_locationBar->text().isEmpty()) {
m_locationBar->setText(url().toEncoded());
emit urlChanged(url());
}
}
}
@ -843,24 +843,27 @@ void WebView::load(const QUrl &url)
if (url.scheme() == "data" || url.scheme() == "qrc") {
QWebView::load(url);
emit urlChanged(url);
m_aboutToLoadUrl = url;
return;
}
if (isUrlValid(url)) {
QWebView::load(url);
emit urlChanged(url);
m_aboutToLoadUrl = url;
return;
}
if (QFile::exists(url.toLocalFile())) {
QWebView::load(url);
emit urlChanged(url);
}
else {
SearchEngine engine = mApp->searchEnginesManager()->activeEngine();
QString urlString = engine.url.replace("%s", url.toString());
QWebView::load(QUrl(urlString));
m_locationBar->setText(urlString);
emit urlChanged(url);
}
}