mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2024-12-14 01:26:00 +01:00
No need to pass Application to RadioBackend
This commit is contained in:
parent
d8f0ae0980
commit
dbf18db3a3
@ -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()) {}
|
||||
|
||||
|
@ -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_;
|
||||
};
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user