From 8b4ae53b71d6365a6a2705fec328c07afd12d2de Mon Sep 17 00:00:00 2001 From: nowrep Date: Wed, 14 Sep 2011 17:40:16 +0200 Subject: [PATCH] Fixed finding on google in locationbar, sometimes it just loads empty google page instead of search results --- src/navigation/locationbar.cpp | 5 ++++- src/webview/tabwidget.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/navigation/locationbar.cpp b/src/navigation/locationbar.cpp index e87007c08..87d963e35 100644 --- a/src/navigation/locationbar.cpp +++ b/src/navigation/locationbar.cpp @@ -92,7 +92,10 @@ void LocationBar::urlEnter() { m_webView->setFocus(); QUrl guessedUrl = WebView::guessUrlFromString(text()); - m_webView->load(guessedUrl); + if (guessedUrl.isEmpty()) + m_webView->load(QUrl(text())); + else + m_webView->load(guessedUrl); setText(guessedUrl.toString()); } diff --git a/src/webview/tabwidget.cpp b/src/webview/tabwidget.cpp index f8e02a332..a5f1b3397 100644 --- a/src/webview/tabwidget.cpp +++ b/src/webview/tabwidget.cpp @@ -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))); if (url.isValid()) - webView->setUrl(url); + webView->load(url); if (selectLine) p_QupZilla->locationBar()->setFocus(); @@ -394,7 +394,7 @@ void TabWidget::restoreClosedTab() QDataStream historyStream(tab.history); historyStream >> *weView(index)->history(); - weView(index)->setUrl(tab.url); + weView(index)->load(tab.url); } void TabWidget::restoreAllClosedTabs() @@ -408,7 +408,7 @@ void TabWidget::restoreAllClosedTabs() QDataStream historyStream(tab.history); historyStream >> *weView(index)->history(); - weView(index)->setUrl(tab.url); + weView(index)->load(tab.url); } m_closedTabsManager->clearList(); } @@ -495,7 +495,7 @@ void TabWidget::restorePinnedTabs() addedIndex= addView(QUrl()); QDataStream historyStream(historyState); historyStream >> *weView(addedIndex)->history(); - weView(addedIndex)->setUrl(url); + weView(addedIndex)->load(url); } else { addedIndex = addView(url); } @@ -564,7 +564,7 @@ bool TabWidget::restoreState(const QByteArray &state) int index = addView(QUrl()); QDataStream historyStream(historyState); historyStream >> *weView(index)->history(); - weView(index)->setUrl(url); + weView(index)->load(url); } else { addView(url); }