aboutsummaryrefslogtreecommitdiff
path: root/src/webclient.hpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-16 22:01:59 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-16 22:01:59 +0200
commita3f3e3933c4a2522e233917a6795c6e9d677e65c (patch)
tree6e1bd483bbd5e8ca6fee4566e544de48bfa754a6 /src/webclient.hpp
parentbc18d9356828f1ae40d3b4ce5432b30ca13cfc15 (diff)
downloadkristall-a3f3e3933c4a2522e233917a6795c6e9d677e65c.tar.gz
Refactoring: Changes internal structure of requests and unifies a lot of code. Now all errors are handled the same.
Diffstat (limited to 'src/webclient.hpp')
-rw-r--r--src/webclient.hpp21
1 files changed, 8 insertions, 13 deletions
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 <QNetworkAccessManager>
#include <QNetworkReply>
-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();