@@ -33,6 +33,7 @@
|
||||
#include <QLabel>
|
||||
#include <QToolButton>
|
||||
|
||||
#include "core/shared_ptr.h"
|
||||
#include "core/iconloader.h"
|
||||
#include "playlist/playlist.h"
|
||||
#include "playlist/playlistdelegates.h"
|
||||
@@ -45,7 +46,7 @@
|
||||
QueueView::QueueView(QWidget *parent)
|
||||
: QWidget(parent),
|
||||
ui_(new Ui_QueueView),
|
||||
playlists_(nullptr),
|
||||
playlist_manager_(nullptr),
|
||||
current_playlist_(nullptr) {
|
||||
|
||||
ui_->setupUi(this);
|
||||
@@ -74,12 +75,12 @@ QueueView::~QueueView() {
|
||||
delete ui_;
|
||||
}
|
||||
|
||||
void QueueView::SetPlaylistManager(PlaylistManager *manager) {
|
||||
void QueueView::SetPlaylistManager(SharedPtr<PlaylistManager> playlist_manager) {
|
||||
|
||||
playlists_ = manager;
|
||||
playlist_manager_ = playlist_manager;
|
||||
|
||||
QObject::connect(playlists_, &PlaylistManager::CurrentChanged, this, &QueueView::CurrentPlaylistChanged);
|
||||
CurrentPlaylistChanged(playlists_->current());
|
||||
QObject::connect(&*playlist_manager, &PlaylistManager::CurrentChanged, this, &QueueView::CurrentPlaylistChanged);
|
||||
CurrentPlaylistChanged(playlist_manager_->current());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <QWidget>
|
||||
#include <QString>
|
||||
|
||||
#include "core/shared_ptr.h"
|
||||
|
||||
class Playlist;
|
||||
class PlaylistManager;
|
||||
class Ui_QueueView;
|
||||
@@ -39,7 +41,7 @@ class QueueView : public QWidget {
|
||||
explicit QueueView(QWidget *parent = nullptr);
|
||||
~QueueView() override;
|
||||
|
||||
void SetPlaylistManager(PlaylistManager *manager);
|
||||
void SetPlaylistManager(SharedPtr<PlaylistManager> playlist_manager);
|
||||
void ReloadSettings();
|
||||
|
||||
private slots:
|
||||
@@ -55,7 +57,7 @@ class QueueView : public QWidget {
|
||||
private:
|
||||
Ui_QueueView *ui_;
|
||||
|
||||
PlaylistManager *playlists_;
|
||||
SharedPtr<PlaylistManager> playlist_manager_;
|
||||
Playlist *current_playlist_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user