summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/webpage.cpp100
-rw-r--r--src/webpage.h2
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,