summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-03-09 17:35:45 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-03-09 17:35:45 +0100
commit3210a9057d5bf2fb7e522055d08994fac8e61b57 (patch)
tree32fe5bb9c27f29f69a110d5bb047121fad21c9e1 /src
parentInclude Tab History when Cloning a Tab (diff)
downloadrekonq-3210a9057d5bf2fb7e522055d08994fac8e61b57.tar.xz
Let rekonq load urls on new tabs on sites checking the referer ;)
Diffstat (limited to 'src')
-rw-r--r--src/webview.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index 019eb42d..ee1ec270 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -894,9 +894,21 @@ void WebView::inspect()
}
-void WebView::loadUrlInNewTab(const KUrl &url)
+void WebView::loadUrlInNewTab(const KUrl &u)
{
- emit loadUrl(url, Rekonq::NewTab);
+ QNetworkRequest req(u);
+ req.setRawHeader(QByteArray("Referer"), url().toEncoded());
+
+ WebTab *w = 0;
+ if (ReKonfig::openLinksInNewWindow())
+ {
+ w = rApp->newMainWindow()->mainView()->currentWebTab();
+ }
+ else
+ {
+ w = rApp->mainWindow()->mainView()->newWebTab(!ReKonfig::openNewTabsInBackground());
+ }
+ w->view()->load(req);
}