diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-04-29 01:11:58 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-04-29 01:11:58 +0200 |
commit | 7a35bdc75a549a617bb3d8440a9a96f551bc26a2 (patch) | |
tree | 1d9d67382c0d3a6fa7f91c8a0366df8e944bbd48 | |
parent | Removed unused Application loadUrl method (diff) | |
download | rekonq-7a35bdc75a549a617bb3d8440a9a96f551bc26a2.tar.xz |
mainview loadurlinCurrentTab improvements
-rw-r--r-- | src/application.cpp | 2 | ||||
-rw-r--r-- | src/mainview.cpp | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/application.cpp b/src/application.cpp index 902c2946..16b24ba0 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -94,7 +94,7 @@ int Application::newInstance() { KUrl url = MainWindow::guessUrlFromString(args->arg(i)); newWebView(); - mainWindow()->loadUrl(url); + mainWindow()->mainView()->loadUrlInCurrentTab(url); } args->clear(); } diff --git a/src/mainview.cpp b/src/mainview.cpp index 7a7b36b3..ed09def9 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -623,9 +623,19 @@ void MainView::aboutToShowRecentTriggeredAction(QAction *action) void MainView::loadUrlInCurrentTab(const KUrl &url) { WebView *webView = currentWebView(); + + KUrl loadingUrl(url); + + if (loadingUrl.isRelative()) + { + QString fn = loadingUrl.url(KUrl::RemoveTrailingSlash); + loadingUrl.setUrl("//" + fn); + loadingUrl.setScheme("http"); + } + if (webView) { - webView->loadUrl(url); + webView->load(loadingUrl); webView->setFocus(); } } |