fix: sorting never changes the queue
Removed the sortApplied→syncQueueToModel connection. Sorting the track list only reorders the view; the queue is only set when a track is actually played (double-click or Play Now), at which point the current sorted order and clicked row are used. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,10 +35,6 @@ Tracks::Tracks(QobuzBackend *backend, PlayQueue *queue, QWidget *parent)
|
||||
connect(this, &QTreeView::customContextMenuRequested,
|
||||
this, &Tracks::onContextMenu);
|
||||
|
||||
// Re-sync queue order whenever the model is re-sorted (user clicked header
|
||||
// or setTracks re-applied an existing sort).
|
||||
connect(m_model, &TrackListModel::sortApplied,
|
||||
this, &Tracks::syncQueueToModel);
|
||||
}
|
||||
|
||||
void Tracks::loadTracks(const QJsonArray &tracks)
|
||||
@@ -65,14 +61,9 @@ void Tracks::loadSearchTracks(const QJsonArray &tracks)
|
||||
|
||||
void Tracks::setPlayingTrackId(qint64 id)
|
||||
{
|
||||
m_playingId = id;
|
||||
m_model->setPlayingId(id);
|
||||
}
|
||||
|
||||
void Tracks::syncQueueToModel()
|
||||
{
|
||||
m_queue->reorderContext(m_model->currentTracksJson(), m_playingId);
|
||||
}
|
||||
|
||||
void Tracks::onDoubleClicked(const QModelIndex &index)
|
||||
{
|
||||
|
||||
@@ -32,10 +32,8 @@ namespace List
|
||||
TrackListModel *m_model = nullptr;
|
||||
QobuzBackend *m_backend = nullptr;
|
||||
PlayQueue *m_queue = nullptr;
|
||||
qint64 m_playingId = 0;
|
||||
|
||||
void onDoubleClicked(const QModelIndex &index);
|
||||
void onContextMenu(const QPoint &pos);
|
||||
void syncQueueToModel();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user