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) Tracks: add 'load to' capabilities to Hidden model #14077

Open
wants to merge 1 commit into
base: 2.5
Choose a base branch
from
Open
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
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
Loading