aboutsummaryrefslogtreecommitdiff
path: root/src/webclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webclient.cpp')
-rw-r--r--src/webclient.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/webclient.cpp b/src/webclient.cpp
index eb5f85e..b317692 100644
--- a/src/webclient.cpp
+++ b/src/webclient.cpp
@@ -3,8 +3,8 @@
#include <QNetworkRequest>
#include <QNetworkReply>
-WebClient::WebClient(QObject *parent) :
- QObject(parent),
+WebClient::WebClient() :
+ ProtocolHandler(nullptr),
current_reply(nullptr)
{
manager.setRedirectPolicy(QNetworkRequest::NoLessSafeRedirectPolicy);
@@ -15,6 +15,11 @@ WebClient::~WebClient()
}
+bool WebClient::supportsScheme(const QString &scheme) const
+{
+ return (scheme == "https") or (scheme == "http");
+}
+
bool WebClient::startRequest(const QUrl &url)
{
if(url.scheme() != "http" and url.scheme() != "https")
@@ -67,7 +72,7 @@ void WebClient::on_finished()
if(this->current_reply->error() != QNetworkReply::NoError)
{
qDebug() << "web network error" << this->current_reply->errorString();
- emit this->requestFailed(this->current_reply->errorString());
+ emit this->networkError(UnknownError, this->current_reply->errorString());
}
else
{