summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/webpage.cpp2
-rw-r--r--src/webpage.h4
-rw-r--r--src/webview.cpp16
-rw-r--r--src/webview.h3
4 files changed, 20 insertions, 5 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp
index b19b1ff2..94ecbe09 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -76,7 +76,6 @@ WebPage::WebPage(QObject *parent, qlonglong windowId)
connect(networkAccessManager(), SIGNAL(finished(QNetworkReply*)), this, SLOT(manageNetworkErrors(QNetworkReply*)));
- connect(this, SIGNAL(downloadRequested(const QNetworkRequest &)), this, SLOT(downloadRequest(const QNetworkRequest &)));
connect(this, SIGNAL(unsupportedContent(QNetworkReply *)), this, SLOT(handleUnsupportedContent(QNetworkReply *)));
}
@@ -257,4 +256,3 @@ bool WebPage::authorizedRequest(const QUrl &url) const
// TODO implement ad-block here
return true;
}
-
diff --git a/src/webpage.h b/src/webpage.h
index fed877ae..eb558220 100644
--- a/src/webpage.h
+++ b/src/webpage.h
@@ -54,14 +54,14 @@ public:
virtual bool authorizedRequest(const QUrl &url) const;
public slots:
- void manageNetworkErrors(QNetworkReply* reply);
+ void manageNetworkErrors(QNetworkReply *reply);
protected:
WebPage *createWindow(WebWindowType type);
virtual bool acceptNavigationRequest(QWebFrame *frame,
const QNetworkRequest &request,
- NavigationType type);//
+ NavigationType type);
protected Q_SLOTS:
virtual void handleUnsupportedContent(QNetworkReply *reply);
diff --git a/src/webview.cpp b/src/webview.cpp
index 2c96f532..f38d363e 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -66,6 +66,9 @@ WebView::WebView(QWidget* parent)
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
connect(this, SIGNAL(linkMiddleOrCtrlClicked(const KUrl &)), this, SLOT(loadInNewTab(const KUrl &)) );
+
+ connect(this, SIGNAL(linkShiftClicked(const KUrl &)), this, SLOT(downloadRequest(const KUrl &)));
+ connect(page(), SIGNAL(downloadRequested(const QNetworkRequest &)), this, SLOT(downloadRequest(const QNetworkRequest &r)));
}
@@ -427,4 +430,15 @@ void WebView::loadInNewTab(const KUrl &url)
{
Application::instance()->loadUrl(url, Rekonq::NewCurrentTab);
}
- \ No newline at end of file
+
+
+void WebView::downloadRequest(const KUrl &url)
+{
+ m_page->downloadRequest(QNetworkRequest(url));
+}
+
+
+void WebView::downloadRequest(const QNetworkRequest &request)
+{
+ m_page->downloadRequest(request);
+}
diff --git a/src/webview.h b/src/webview.h
index e4a0cc59..4fa87978 100644
--- a/src/webview.h
+++ b/src/webview.h
@@ -73,6 +73,9 @@ private slots:
void loadInNewTab(const KUrl &url);
+ void downloadRequest(const KUrl &url);
+ void downloadRequest(const QNetworkRequest &request);
+
private:
WebPage *m_page;
int m_progress;