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

@@ -30,6 +30,7 @@
#include <QString>
#include <QAtomicInt>
class NetworkAccessManager;
class LyricsProvider;
class LyricsProviders : public QObject {
@@ -48,6 +49,8 @@ class LyricsProviders : public QObject {
bool HasAnyProviders() const { return !lyrics_providers_.isEmpty(); }
int NextId();
NetworkAccessManager *network() const { return network_; }
private slots:
void ProviderDestroyed();
@@ -56,6 +59,8 @@ class LyricsProviders : public QObject {
static int NextOrderId;
NetworkAccessManager *network_;
QMap<LyricsProvider*, QString> lyrics_providers_;
QList<LyricsProvider*> ordered_providers_;
QMutex mutex_;