Skip to content

Commit

Permalink
Merge pull request mixxxdj#14077 from ronso0/tracks-hidden-add-load-c…
Browse files Browse the repository at this point in the history
…apabilities

(fix) Tracks: add 'load to' capabilities to Hidden model
  • Loading branch information
daschuer authored Jan 30, 2025
2 parents ecf783b + 9b80dbd commit 531ad2d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
6 changes: 6 additions & 0 deletions src/library/missing_hidden/hiddentablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ TrackModel::Capabilities HiddenTableModel::getCapabilities() const {
Capability::Unhide |
Capability::RemoveFromDisk |
Capability::EditMetadata |
Capability::AddToAutoDJ |
Capability::LoadToDeck |
Capability::LoadToSampler |
Capability::LoadToPreviewDeck |
Capability::ResetPlayed |
Capability::Analyze |
Capability::Properties;
}

Expand Down
30 changes: 14 additions & 16 deletions src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,16 @@ void WTrackTableView::loadTrackModel(QAbstractItemModel* model, bool restoreStat
// QHeaderView here saves on setModel() calls. Since we parent the
// QHeaderView to the WTrackTableView, it is automatically deleted.
auto* tempHeader = new QHeaderView(Qt::Horizontal, this);
/* Tobias Rafreider: DO NOT SET SORTING TO TRUE during header replacement
* Otherwise, setSortingEnabled(1) will immediately trigger sortByColumn()
* For some reason this will cause 4 select statements in series
* from which 3 are redundant --> expensive at all
*
* Sorting columns, however, is possible because we
* enable clickable sorting indicators some lines below.
* Furthermore, we connect signal 'sortIndicatorChanged'.
*
* Fixes Bug #672762
*/
// Tobias Rafreider: DO NOT SET SORTING TO TRUE during header replacement
// Otherwise, setSortingEnabled(1) will immediately trigger sortByColumn()
// For some reason this will cause 4 select statements in series
// from which 3 are redundant --> expensive at all
//
// Sorting columns, however, is possible because we
// enable clickable sorting indicators some lines below.
// Furthermore, we connect signal 'sortIndicatorChanged'.
//
// Fixes Bug https://github.com/mixxxdj/mixxx/issues/5643

setSortingEnabled(false);
setHorizontalHeader(tempHeader);
Expand Down Expand Up @@ -259,11 +258,10 @@ void WTrackTableView::loadTrackModel(QAbstractItemModel* model, bool restoreStat
//qDebug() << "Hiding column" << i;
horizontalHeader()->hideSection(i);
}
/* If Mixxx starts the first time or the header states have been cleared
* due to database schema evolution we gonna hide all columns that may
* contain a potential large number of NULL values. This will hide the
* key column by default unless the user brings it to front
*/
// If Mixxx starts the first time or the header states have been cleared
// due to database schema evolution we gonna hide all columns that may
// contain a potential large number of NULL values. This will hide the
// key column by default unless the user brings it to front
if (pTrackModel->isColumnHiddenByDefault(i) &&
!header->hasPersistedHeaderState()) {
//qDebug() << "Hiding column" << i;
Expand Down

0 comments on commit 531ad2d

Please sign in to comment.