summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index ed09def9..df42a340 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -300,7 +300,7 @@ WebView *MainView::newWebView(bool makeCurrent)
{
// line edit
UrlBar *urlBar = new UrlBar; // Ownership of widget is passed on to the QStackedWidget (addWidget method).
- connect(urlBar, SIGNAL(activated(const KUrl&)), this, SLOT(loadUrlInCurrentTab(const KUrl&)));
+ connect(urlBar, SIGNAL(activated(const KUrl&)), this, SLOT(loadUrl(const KUrl&)));
m_urlBars->addUrlBar(urlBar);
WebView *webView = new WebView; // should be deleted on tab close
@@ -616,12 +616,17 @@ void MainView::aboutToShowRecentTabsMenu()
void MainView::aboutToShowRecentTriggeredAction(QAction *action)
{
KUrl url = action->data().toUrl();
- loadUrlInCurrentTab(url);
+ loadUrl(url);
}
-void MainView::loadUrlInCurrentTab(const KUrl &url)
+void MainView::loadUrl(const KUrl &url)
{
+ if (url.isEmpty())
+ return;
+
+ currentUrlBar()->setUrl(url.prettyUrl());
+
WebView *webView = currentWebView();
KUrl loadingUrl(url);