diff options
author | Michael Neves | 2012-01-30 20:31:15 +0100 |
---|---|---|
committer | Michael Neves | 2012-01-30 20:31:15 +0100 |
commit | 7faab870fa5a17c669f4def25479ce24b18520c3 (patch) | |
tree | 772f96a2b7524048e37dd6a7b20c6547557017ea | |
parent | Added SSL ErrorHandler for QWebViews NetworkAccessManager (diff) | |
download | fbgui-7faab870fa5a17c669f4def25479ce24b18520c3.tar.gz fbgui-7faab870fa5a17c669f4def25479ce24b18520c3.tar.xz fbgui-7faab870fa5a17c669f4def25479ce24b18520c3.zip |
Added HTTP Error Handling
-rw-r--r-- | src/fbgui/fbgui.cpp | 17 | ||||
-rw-r--r-- | src/fbgui/fbgui.h | 6 |
2 files changed, 20 insertions, 3 deletions
diff --git a/src/fbgui/fbgui.cpp b/src/fbgui/fbgui.cpp index 4c4a833..fcc652c 100644 --- a/src/fbgui/fbgui.cpp +++ b/src/fbgui/fbgui.cpp @@ -245,6 +245,12 @@ void fbgui::loadURL() { QByteArray postData = generatePOSTData(); QNetworkRequest req(baseURL); + //Connect webViews NetworkAccessManager to SSLErrorHandler SLOT + QObject::connect(_webView->page()->networkAccessManager(), + SIGNAL(finished(QNetworkReply*)), + this, + SLOT(errorHandler(QNetworkReply*))); + //Connect webViews NetworkAccessManager to ErrorHandler SLOT QObject::connect(_webView->page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> & )), @@ -272,7 +278,7 @@ void fbgui::loadURLDone(bool success) { } -//Handles SSL Errors +//Handles QNetworkReply SSL Errors void fbgui::sslErrorHandler(QNetworkReply* reply, const QList<QSslError> & errlist) { @@ -282,6 +288,15 @@ void fbgui::sslErrorHandler(QNetworkReply* reply, const QList<QSslError> & errli reply->ignoreSslErrors(); } +//Handles QNetworkReply Errors +void fbgui::errorHandler(QNetworkReply* reply) +{ + + LOG4CXX_DEBUG(coreLogger, "HTTP Error: " << reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString()); + + +} + //------------------------------------------------------------------------------------------- /** diff --git a/src/fbgui/fbgui.h b/src/fbgui/fbgui.h index a13fe74..04aa38b 100644 --- a/src/fbgui/fbgui.h +++ b/src/fbgui/fbgui.h @@ -116,9 +116,11 @@ private slots: void prepareURLLoad(const QString&); void loadURLDone(bool success); - //ssl Error Handler for SSL Requests - void sslErrorHandler(QNetworkReply* qnr, const QList<QSslError> & errlist); + //SSL Error Handler for SSL Requests + void sslErrorHandler(QNetworkReply* reply, const QList<QSslError> & errlist); + //Error Handler for http Requests + void errorHandler(QNetworkReply* reply); // shut off the system void performShutDown(); |