summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-04-29 01:41:58 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-04-29 01:41:58 +0200
commit5fb7d909e87be4ea5a07b7a29271c96b7db4a9b3 (patch)
tree66446357b150a6aa5e675ec75b65973787fb3ad7 /src/mainview.cpp
parentRemoved loadUrl method from WebView (diff)
downloadrekonq-5fb7d909e87be4ea5a07b7a29271c96b7db4a9b3.tar.xz
Fixed loading Url methods.
Now in all rekonq code we have just a loadUrl method in mainview (doing the dirty job) and one in mainwindow, provided for convenience. Every class needing loading an url has a openUrl signal. Hope this should go well..
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);