WSJT-X/Network/NetworkAccessManager.hpp

35 lines
749 B
C++
Raw Normal View History

#ifndef NETWORK_ACCESS_MANAGER_HPP__
#define NETWORK_ACCESS_MANAGER_HPP__
#include <QNetworkAccessManager>
#include <QList>
#include <QSslError>
#include "widgets/MessageBox.hpp"
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
public:
2020-07-12 19:55:42 -04:00
explicit NetworkAccessManager (QWidget * parent);
protected:
2020-07-12 19:55:42 -04:00
QNetworkReply * createRequest (Operation, QNetworkRequest const&, QIODevice * = nullptr) override;
private:
2020-07-12 19:55:42 -04:00
void filter_SSL_errors (QNetworkReply * reply, QList<QSslError> const& errors);
QWidget * parent_widget_;
QList<QSslError> allowed_ssl_errors_;
};
#endif