From a3f3e3933c4a2522e233917a6795c6e9d677e65c Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Tue, 16 Jun 2020 22:01:59 +0200 Subject: Refactoring: Changes internal structure of requests and unifies a lot of code. Now all errors are handled the same. --- src/webclient.hpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/webclient.hpp') diff --git a/src/webclient.hpp b/src/webclient.hpp index f6b3b92..2a5b80d 100644 --- a/src/webclient.hpp +++ b/src/webclient.hpp @@ -5,29 +5,24 @@ #include #include -class WebClient: public QObject +#include "protocolhandler.hpp" + +class WebClient: public ProtocolHandler { private: Q_OBJECT public: - explicit WebClient(QObject *parent = nullptr); + explicit WebClient(); ~WebClient() override; - bool startRequest(QUrl const & url); - - bool isInProgress() const; - - bool cancelRequest(); - -signals: - void requestProgress(qint64 transferred); + bool supportsScheme(QString const & scheme) const override; - void requestComplete(QByteArray const & data, QString const & mime); + bool startRequest(QUrl const & url) override; - void requestFailed(QString const & message); + bool isInProgress() const override; - void networkError(QString const & message); + bool cancelRequest() override; private slots: void on_data(); -- cgit v1.2.3