1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-14 09:44:51 +01:00

No need to pass Application to RadioBackend

This commit is contained in:
Jonas Kvinge 2021-07-11 01:12:50 +02:00
parent d8f0ae0980
commit dbf18db3a3
3 changed files with 3 additions and 7 deletions

View File

@ -22,15 +22,13 @@
#include <QMutexLocker>
#include "core/logging.h"
#include "core/application.h"
#include "core/database.h"
#include "core/song.h"
#include "radiobackend.h"
#include "radiochannel.h"
RadioBackend::RadioBackend(Application *app, Database *db, QObject *parent)
RadioBackend::RadioBackend(Database *db, QObject *parent)
: QObject(parent),
app_(app),
db_(db),
original_thread_(thread()) {}

View File

@ -24,14 +24,13 @@
#include "radiochannel.h"
class Application;
class Database;
class RadioBackend : public QObject {
Q_OBJECT
public:
explicit RadioBackend(Application *app, Database *db, QObject *parent = nullptr);
explicit RadioBackend(Database *db, QObject *parent = nullptr);
void Close();
void ExitAsync();
@ -53,7 +52,6 @@ class RadioBackend : public QObject {
void Exit();
private:
Application *app_;
Database *db_;
QThread *original_thread_;
};

View File

@ -38,7 +38,7 @@ RadioServices::RadioServices(Application *app, QObject *parent)
model_(new RadioModel(app, this)),
channels_refresh_(false) {
backend_ = new RadioBackend(app, app->database());
backend_ = new RadioBackend(app->database());
app->MoveToThread(backend_, app->database()->thread());
QObject::connect(backend_, &RadioBackend::NewChannels, this, &RadioServices::GotChannelsFromBackend);