Skip to content
Merged
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
16 changes: 7 additions & 9 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,13 +1498,13 @@ void WTrackTableView::addSelectionToPlaylist(int iPlaylistId) {
playlistDao.appendTracksToPlaylist(trackIds, iPlaylistId);
}

void WTrackTableView::addRemoveSelectionInCrate(QWidget* qc) {
QVariant crateqv = qc->property("crateId");
if (!crateqv.canConvert<CrateId>()) {
qWarning() << "crateId is not ef CrateId type";
void WTrackTableView::addRemoveSelectionInCrate(QWidget* pWidget) {
auto pCheckBox = qobject_cast<QCheckBox*>(pWidget);
VERIFY_OR_DEBUG_ASSERT(pCheckBox) {
qWarning() << "pWidget is not a QCheckBox";
return;
}
CrateId crateId = crateqv.value<CrateId>();
CrateId crateId = pCheckBox->property("crateId").value<CrateId>();

const QList<TrackId> trackIds = getSelectedTrackIds();

Expand All @@ -1514,10 +1514,8 @@ void WTrackTableView::addRemoveSelectionInCrate(QWidget* qc) {
}

// we need to disable tristate again as the mixed state will now be gone and can't be brought back
if (qc->property("tristate").toBool() == true) {
qc->setProperty("tristate", false);
}
if(qc->property("checked").toBool() == false) {
pCheckBox->setTristate(false);
if(!pCheckBox->isChecked()) {
if (crateId.isValid()) {
m_pTrackCollection->removeCrateTracks(crateId, trackIds);
}
Expand Down