Silented errors for nam for feed fetching.

This commit is contained in:
Martin Rotter 2013-12-23 11:51:56 +01:00
parent af56fbcf1a
commit a49df4f2cf
2 changed files with 24 additions and 0 deletions

View File

@ -1,10 +1,29 @@
#include "core/silentnetworkaccessmanager.h"
#include <QNetworkReply>
SilentNetworkAccessManager::SilentNetworkAccessManager(QObject *parent)
: BaseNetworkAccessManager(parent) {
}
SilentNetworkAccessManager::~SilentNetworkAccessManager() {
qDebug("Destroying SilentNetworkAccessManages instance.");
}
void SilentNetworkAccessManager::onSslErrors(QNetworkReply *reply,
const QList<QSslError> &error) {
qDebug("SSL errors for '%s'.",
qPrintable(reply->url().toString()));
reply->ignoreSslErrors(error);
}
void SilentNetworkAccessManager::onAuthenticationRequired(QNetworkReply *reply,
QAuthenticator *authenticator) {
Q_UNUSED(authenticator)
qDebug("Authentification problems for '%s'.",
qPrintable(reply->url().toString()));
}

View File

@ -12,6 +12,11 @@ class SilentNetworkAccessManager : public BaseNetworkAccessManager {
// Constructors and destructors.
explicit SilentNetworkAccessManager(QObject *parent = 0);
virtual ~SilentNetworkAccessManager();
protected slots:
void onSslErrors(QNetworkReply *reply, const QList<QSslError> &error);
void onAuthenticationRequired(QNetworkReply * reply, QAuthenticator *authenticator);
};
#endif // SILENTNETWORKACCESSMANAGES_H