Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) Playlists: paint sidebar items bold immediateley after dropping tracks #13575

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/library/trackset/baseplaylistfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ void BasePlaylistFeature::updateChildModel(const QSet<int>& playlistIds) {
label = fetchPlaylistLabel(id);
pChild->setLabel(label);
decorateChild(pChild, id);
markTreeItem(pChild);
}
}
} else {
Expand All @@ -780,6 +781,7 @@ void BasePlaylistFeature::updateChildModel(const QSet<int>& playlistIds) {
label = fetchPlaylistLabel(id);
pTreeItem->setLabel(label);
decorateChild(pTreeItem, id);
markTreeItem(pTreeItem);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/library/trackset/baseplaylistfeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class BasePlaylistFeature : public BaseTrackSetFeature {
PlaylistTableModel* m_pPlaylistTableModel;
QSet<int> m_playlistIdsOfSelectedTrack;
const QString m_countsDurationTableName;
TrackId m_selectedTrackId;

private slots:
void slotTrackSelected(TrackId trackId);
Expand All @@ -129,7 +130,6 @@ class BasePlaylistFeature : public BaseTrackSetFeature {
void markTreeItem(TreeItem* pTreeItem);
QString fetchPlaylistLabel(int playlistId);

TrackId m_selectedTrackId;

const bool m_keepHiddenTracks;
};
3 changes: 3 additions & 0 deletions src/library/trackset/playlistfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ void PlaylistFeature::slotPlaylistContentOrLockChanged(const QSet<int>& playlist
idsToBeUpdated.insert(playlistId);
}
}
// Update the playlists set to allow toggling bold correctly after
// tracks have been dropped on sidebar items
m_playlistDao.getPlaylistsTrackIsIn(m_selectedTrackId, &m_playlistIdsOfSelectedTrack);
updateChildModel(idsToBeUpdated);
}

Expand Down