From 06b43a83c432ae50fbc1e01e277aa4caf98df72e Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 26 Nov 2012 19:15:24 +0100 Subject: Open focused link when launched from web app --- src/application.cpp | 2 +- src/webtab/webview.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index 06f9fd82..84418b4b 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -393,7 +393,7 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) } else if (newType == Rekonq::NewWindow || (newType == Rekonq::NewTab && ReKonfig::openLinksInNewWindow()) - || (newType == Rekonq::NewTab && tabWindowList().count() == 0)) + || ((newType == Rekonq::NewTab || newType == Rekonq::NewFocusedTab) && tabWindowList().count() == 0)) { w = newTabWindow(); newType = Rekonq::CurrentTab; diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index 48c35615..0cc09574 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -764,7 +764,13 @@ void WebView::openLinkInNewTab() KAction *a = qobject_cast(sender()); KUrl url(a->data().toUrl()); - emit loadUrl(url, Rekonq::NewTab); + WebTab *tab = qobject_cast(parent()); + WebWindow *webwin = tab->webWindow(); + + if (webwin) + emit loadUrl(url, Rekonq::NewTab); + else + emit loadUrl(url, Rekonq::NewFocusedTab); } void WebView::openLinkInPrivateWindow() -- cgit v1.2.1