diff options
-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(); } } |