2016-12-04 09:17:01 -05:00
|
|
|
#ifndef NETWORK_ACCESS_MANAGER_HPP__
|
|
|
|
#define NETWORK_ACCESS_MANAGER_HPP__
|
|
|
|
|
|
|
|
#include <QNetworkAccessManager>
|
|
|
|
#include <QList>
|
|
|
|
#include <QSslError>
|
|
|
|
|
2018-11-07 12:49:45 -05:00
|
|
|
#include "widgets/MessageBox.hpp"
|
2016-12-04 09:17:01 -05:00
|
|
|
|
|
|
|
class QNetworkRequest;
|
|
|
|
class QIODevice;
|
|
|
|
class QWidget;
|
|
|
|
|
|
|
|
// sub-class QNAM to keep a list of accepted SSL errors and allow
|
|
|
|
// them in future replies
|
|
|
|
class NetworkAccessManager
|
|
|
|
: public QNetworkAccessManager
|
|
|
|
{
|
2020-07-12 19:55:42 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
2016-12-04 09:17:01 -05:00
|
|
|
public:
|
2020-07-12 19:55:42 -04:00
|
|
|
explicit NetworkAccessManager (QWidget * parent);
|
2016-12-04 09:17:01 -05:00
|
|
|
|
|
|
|
protected:
|
2020-07-12 19:55:42 -04:00
|
|
|
QNetworkReply * createRequest (Operation, QNetworkRequest const&, QIODevice * = nullptr) override;
|
2016-12-04 09:17:01 -05:00
|
|
|
|
|
|
|
private:
|
2020-07-12 19:55:42 -04:00
|
|
|
void filter_SSL_errors (QNetworkReply * reply, QList<QSslError> const& errors);
|
|
|
|
|
|
|
|
QWidget * parent_widget_;
|
2016-12-04 09:17:01 -05:00
|
|
|
QList<QSslError> allowed_ssl_errors_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|