Application: Use shared pointers

Fixes #1239
This commit is contained in:
Jonas Kvinge
2023-07-21 05:55:24 +02:00
parent d6b53f78ab
commit 2e61235403
316 changed files with 2170 additions and 1643 deletions

View File

@@ -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());
}