1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 02:52:12 +01:00

Fixed finding on google in locationbar, sometimes it just loads empty

google page instead of search results
This commit is contained in:
nowrep 2011-09-14 17:40:16 +02:00
parent 28bfa1e549
commit 8b4ae53b71
2 changed files with 9 additions and 6 deletions

View File

@ -92,6 +92,9 @@ void LocationBar::urlEnter()
{ {
m_webView->setFocus(); m_webView->setFocus();
QUrl guessedUrl = WebView::guessUrlFromString(text()); QUrl guessedUrl = WebView::guessUrlFromString(text());
if (guessedUrl.isEmpty())
m_webView->load(QUrl(text()));
else
m_webView->load(guessedUrl); m_webView->load(guessedUrl);
setText(guessedUrl.toString()); setText(guessedUrl.toString());
} }

View File

@ -245,7 +245,7 @@ int TabWidget::addView(QUrl url, const QString &title, OpenUrlIn openIn, bool se
connect(webView, SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString))); connect(webView, SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString)));
if (url.isValid()) if (url.isValid())
webView->setUrl(url); webView->load(url);
if (selectLine) if (selectLine)
p_QupZilla->locationBar()->setFocus(); p_QupZilla->locationBar()->setFocus();
@ -394,7 +394,7 @@ void TabWidget::restoreClosedTab()
QDataStream historyStream(tab.history); QDataStream historyStream(tab.history);
historyStream >> *weView(index)->history(); historyStream >> *weView(index)->history();
weView(index)->setUrl(tab.url); weView(index)->load(tab.url);
} }
void TabWidget::restoreAllClosedTabs() void TabWidget::restoreAllClosedTabs()
@ -408,7 +408,7 @@ void TabWidget::restoreAllClosedTabs()
QDataStream historyStream(tab.history); QDataStream historyStream(tab.history);
historyStream >> *weView(index)->history(); historyStream >> *weView(index)->history();
weView(index)->setUrl(tab.url); weView(index)->load(tab.url);
} }
m_closedTabsManager->clearList(); m_closedTabsManager->clearList();
} }
@ -495,7 +495,7 @@ void TabWidget::restorePinnedTabs()
addedIndex= addView(QUrl()); addedIndex= addView(QUrl());
QDataStream historyStream(historyState); QDataStream historyStream(historyState);
historyStream >> *weView(addedIndex)->history(); historyStream >> *weView(addedIndex)->history();
weView(addedIndex)->setUrl(url); weView(addedIndex)->load(url);
} else { } else {
addedIndex = addView(url); addedIndex = addView(url);
} }
@ -564,7 +564,7 @@ bool TabWidget::restoreState(const QByteArray &state)
int index = addView(QUrl()); int index = addView(QUrl());
QDataStream historyStream(historyState); QDataStream historyStream(historyState);
historyStream >> *weView(index)->history(); historyStream >> *weView(index)->history();
weView(index)->setUrl(url); weView(index)->load(url);
} else { } else {
addView(url); addView(url);
} }