diff options
| author | xiphon <xiphon@protonmail.com> | 2020-07-29 17:43:02 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2020-07-30 16:49:22 +0000 |
| commit | 43aeea8eb7965e41f18ae14f3cd3db5e41e77ed7 (patch) | |
| tree | 96849be20f3de69fc490433f1afa14165f115510 /src/qt/network.h | |
| parent | 7eeda0a8f075a0d0938486cf0d7718d9d9491c20 (diff) | |
| download | monzero-gui-43aeea8eb7965e41f18ae14f3cd3db5e41e77ed7.tar.gz monzero-gui-43aeea8eb7965e41f18ae14f3cd3db5e41e77ed7.tar.xz monzero-gui-43aeea8eb7965e41f18ae14f3cd3db5e41e77ed7.zip | |
Network: instantiable QML type, introduce proxyAddress property
# Conflicts:
# main.qml
Diffstat (limited to 'src/qt/network.h')
| -rw-r--r-- | src/qt/network.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/qt/network.h b/src/qt/network.h index e741247d..f895ed3d 100644 --- a/src/qt/network.h +++ b/src/qt/network.h @@ -35,12 +35,12 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wreorder" -#include <net/http_client.h> +#include <net/http.h> #pragma GCC diagnostic pop #include "FutureScheduler.h" -class HttpClient : public QObject, public epee::net_utils::http::http_simple_client +class HttpClient : public QObject, public net::http::client { Q_OBJECT Q_PROPERTY(quint64 contentLength READ contentLength NOTIFY contentLengthChanged); @@ -70,6 +70,8 @@ private: class Network : public QObject { Q_OBJECT + Q_PROPERTY(QString proxyAddress MEMBER m_proxyAddress NOTIFY proxyAddressChanged) + public: Network(QObject *parent = nullptr); @@ -79,11 +81,18 @@ public: std::string get(const QString &url, const QString &contentType = {}) const; QString get( - std::shared_ptr<epee::net_utils::http::http_simple_client> httpClient, + std::shared_ptr<epee::net_utils::http::abstract_http_client> httpClient, const QString &url, std::string &response, const QString &contentType = {}) const; +signals: + void proxyAddressChanged() const; + +private: + std::shared_ptr<epee::net_utils::http::abstract_http_client> newClient() const; + private: + QString m_proxyAddress; mutable FutureScheduler m_scheduler; }; |
