diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-11-12 15:35:05 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-11-13 02:51:47 +0100 |
commit | c50290e8fdbce0e7736a717cf44c8ab8b062fe77 (patch) | |
tree | 0365730b3ef251b9e8efad62d442e985770b84e6 | |
parent | Connecting new KWebView signals to some proper slots (diff) | |
download | rekonq-c50290e8fdbce0e7736a717cf44c8ab8b062fe77.tar.xz |
KIO download system
ported to kdewebkit signals and functions
-rw-r--r-- | src/webpage.cpp | 2 | ||||
-rw-r--r-- | src/webpage.h | 4 | ||||
-rw-r--r-- | src/webview.cpp | 16 | ||||
-rw-r--r-- | src/webview.h | 3 |
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; |