Refactoring
This commit is contained in:
@@ -30,24 +30,25 @@
|
||||
#include <QList>
|
||||
#include <QSet>
|
||||
#include <QString>
|
||||
#include <QSqlQuery>
|
||||
|
||||
#include "core/shared_ptr.h"
|
||||
#include "includes/shared_ptr.h"
|
||||
#include "core/song.h"
|
||||
#include "core/sqlquery.h"
|
||||
#include "core/sqlrow.h"
|
||||
#include "playlistitem.h"
|
||||
#include "smartplaylists/playlistgenerator.h"
|
||||
|
||||
class QThread;
|
||||
class Application;
|
||||
class Database;
|
||||
class TagReaderClient;
|
||||
|
||||
class PlaylistBackend : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_INVOKABLE explicit PlaylistBackend(Application *app, QObject *parent = nullptr);
|
||||
Q_INVOKABLE explicit PlaylistBackend(const SharedPtr<Database> database,
|
||||
const SharedPtr<TagReaderClient> tagreader_client,
|
||||
const SharedPtr<CollectionBackend> collection_backend,
|
||||
QObject *parent = nullptr);
|
||||
|
||||
struct Playlist {
|
||||
Playlist() : id(-1), favorite(false), last_played(0) {}
|
||||
@@ -84,8 +85,6 @@ class PlaylistBackend : public QObject {
|
||||
void FavoritePlaylist(const int id, bool is_favorite);
|
||||
void RemovePlaylist(const int id);
|
||||
|
||||
Application *app() const { return app_; }
|
||||
|
||||
public Q_SLOTS:
|
||||
void Exit();
|
||||
void SavePlaylist(const int playlist, const PlaylistItemPtrList &items, const int last_played, PlaylistGeneratorPtr dynamic);
|
||||
@@ -110,8 +109,9 @@ class PlaylistBackend : public QObject {
|
||||
};
|
||||
PlaylistList GetPlaylists(const GetPlaylistsFlags flags);
|
||||
|
||||
Application *app_;
|
||||
SharedPtr<Database> db_;
|
||||
const SharedPtr<Database> database_;
|
||||
const SharedPtr<TagReaderClient> tagreader_client_;
|
||||
const SharedPtr<CollectionBackend> collection_backend_;
|
||||
QThread *original_thread_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user