MainWindow: Don't use the playlists backend on right click

Fixes #1478
This commit is contained in:
Jonas Kvinge 2024-08-24 22:43:16 +02:00
parent 5c2989196f
commit 08224443e3
1 changed files with 6 additions and 6 deletions

View File

@ -2071,13 +2071,13 @@ void MainWindow::PlaylistRightClick(const QPoint global_pos, const QModelIndex &
QMenu *add_to_another_menu = new QMenu(tr("Add to another playlist"), this);
add_to_another_menu->setIcon(IconLoader::Load(QStringLiteral("list-add")));
const PlaylistBackend::PlaylistList playlists = app_->playlist_backend()->GetAllOpenPlaylists();
for (const PlaylistBackend::Playlist &playlist : playlists) {
// don't add the current playlist
if (playlist.id != app_->playlist_manager()->current()->id()) {
const QList<int> playlist_ids = app_->playlist_manager()->playlist_ids();
for (const int playlist_id : playlist_ids) {
// Don't add the current playlist
if (playlist_id != app_->playlist_manager()->current()->id()) {
QAction *existing_playlist = new QAction(this);
existing_playlist->setText(playlist.name);
existing_playlist->setData(playlist.id);
existing_playlist->setText(app_->playlist_manager()->playlist_name(playlist_id));
existing_playlist->setData(playlist_id);
add_to_another_menu->addAction(existing_playlist);
}
}