Reduce network access managers

This commit is contained in:
Jonas Kvinge
2021-08-12 23:00:10 +02:00
parent f2d52f83fe
commit e6858719c9
41 changed files with 91 additions and 104 deletions

View File

@@ -31,14 +31,16 @@
#include "lyricsprovider.h"
class NetworkAccessManager;
class QNetworkReply;
class JsonLyricsProvider : public LyricsProvider {
Q_OBJECT
public:
explicit JsonLyricsProvider(const QString &name, const bool enabled = true, const bool authentication_required = false, QObject *parent = nullptr);
explicit JsonLyricsProvider(const QString &name, const bool enabled, const bool authentication_required, NetworkAccessManager *network, QObject *parent = nullptr);
protected:
QByteArray ExtractData(QNetworkReply *reply);
QJsonObject ExtractJsonObj(const QByteArray &data);
QJsonObject ExtractJsonObj(QNetworkReply *reply);