diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-11-26 19:15:24 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:06 +0100 |
commit | 06b43a83c432ae50fbc1e01e277aa4caf98df72e (patch) | |
tree | 8be2765e6bd2ce47550eceaa5bedfd6c70011419 | |
parent | Fix tabs moves when some of them are pinned (diff) | |
download | rekonq-06b43a83c432ae50fbc1e01e277aa4caf98df72e.tar.xz |
Open focused link when launched from web app
-rw-r--r-- | src/application.cpp | 2 | ||||
-rw-r--r-- | src/webtab/webview.cpp | 8 |
2 files changed, 8 insertions, 2 deletions
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<KAction*>(sender()); KUrl url(a->data().toUrl()); - emit loadUrl(url, Rekonq::NewTab); + WebTab *tab = qobject_cast<WebTab *>(parent()); + WebWindow *webwin = tab->webWindow(); + + if (webwin) + emit loadUrl(url, Rekonq::NewTab); + else + emit loadUrl(url, Rekonq::NewFocusedTab); } void WebView::openLinkInPrivateWindow() |