diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-05-26 15:06:40 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-05-26 15:06:40 +0200 |
commit | 65887b14f377e6db3fb439a90ca7abd69403f88c (patch) | |
tree | 2c15512200dc7e5feb64fdd689b30ce4418446fb /src | |
parent | load AccessManager Proxy fix (diff) | |
download | rekonq-65887b14f377e6db3fb439a90ca7abd69403f88c.tar.xz |
managing Network Reply Errors. STEP 1
Diffstat (limited to 'src')
-rw-r--r-- | src/webpage.cpp | 100 | ||||
-rw-r--r-- | src/webpage.h | 2 |
2 files changed, 102 insertions, 0 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index bfc128b8..e941d2d5 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -69,7 +69,107 @@ WebPage::WebPage(QObject *parent) : KWebPage(parent) { setForwardUnsupportedContent(true); + setNetworkAccessManager(Application::networkAccessManager()); + connect(networkAccessManager(), SIGNAL(finished(QNetworkReply*)), this, SLOT(manageNetworkErrors(QNetworkReply*))); +} + + +void WebPage::manageNetworkErrors(QNetworkReply* reply) +{ + switch(reply->error()) + { + + case QNetworkReply::NoError: + kDebug() << "NoError"; + return; + break; + + case QNetworkReply::ConnectionRefusedError: + kDebug() << "ConnectionRefusedError"; + break; + + case QNetworkReply::RemoteHostClosedError: + kDebug() << "RemoteHostClosedError"; + break; + + case QNetworkReply::HostNotFoundError: + kDebug() << "HostNotFoundError"; + break; + + case QNetworkReply::TimeoutError: + kDebug() << "TimeoutError"; + break; + + case QNetworkReply::OperationCanceledError: + kDebug() << "OperationCanceledError"; + break; + + case QNetworkReply::SslHandshakeFailedError: + kDebug() << "SslHandshakeFailedError"; + break; + + case QNetworkReply::ProxyConnectionRefusedError: + kDebug() << "ProxyConnectionRefusedError"; + break; + + case QNetworkReply::ProxyConnectionClosedError: + kDebug() << "ProxyConnectionClosedError"; + break; + + case QNetworkReply::ProxyNotFoundError: + kDebug() << "ProxyNotFoundError"; + break; + + case QNetworkReply::ProxyTimeoutError: + kDebug() << "ProxyTimeoutError"; + break; + + case QNetworkReply::ProxyAuthenticationRequiredError: + kDebug() << "ProxyAuthenticationRequiredError"; + break; + + case QNetworkReply::ContentAccessDenied: + kDebug() << "ContentAccessDenied"; + break; + + case QNetworkReply::ContentOperationNotPermittedError: + kDebug() << "ContentOperationNotPermittedError"; + break; + + case QNetworkReply::ContentNotFoundError: + kDebug() << "ContentNotFoundError"; + break; + + case QNetworkReply::AuthenticationRequiredError: + kDebug() << "AuthenticationRequiredError"; + break; + + case QNetworkReply::ProtocolUnknownError: + kDebug() << "ProtocolUnknownError"; + break; + + case QNetworkReply::ProtocolInvalidOperationError: + kDebug() << "ProtocolInvalidOperationError"; + break; + + case QNetworkReply::UnknownNetworkError: + kDebug() << "UnknownNetworkError"; + break; + + case QNetworkReply::UnknownProxyError: + kDebug() << "UnknownProxyError"; + break; + + case QNetworkReply::UnknownContentError: + kDebug() << "UnknownContentError"; + break; + + case QNetworkReply::ProtocolFailure: + kDebug() << "ProtocolFailure"; + break; + + }; } diff --git a/src/webpage.h b/src/webpage.h index abb25171..ba440663 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -55,6 +55,8 @@ class WebPage : public KWebPage public: explicit WebPage(QObject *parent = 0); +public slots: + void manageNetworkErrors(QNetworkReply* reply); protected: bool acceptNavigationRequest(QWebFrame *frame, |