From c7c5218a8ce51a9bc3384903b056ec485d46e0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 26 May 2018 23:11:09 +0200 Subject: [PATCH 1/2] manually call doSortByColumn in Qt5, because the required signal is not emmitted in Qt4 --- src/widget/wtracktableview.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp index f70d20b471..8813d298eb 100644 --- a/src/widget/wtracktableview.cpp +++ b/src/widget/wtracktableview.cpp @@ -358,10 +358,14 @@ void WTrackTableView::loadTrackModel(QAbstractItemModel *model) { // Stupid hack that assumes column 0 is never visible, but this is a weak // proxy for "there was a saved column sort order" if (horizontalHeader()->sortIndicatorSection() > 0) { - // Sort by the saved sort section and order. This line sorts the - // TrackModel and in turn generates a select() + // Sort by the saved sort section and order. horizontalHeader()->setSortIndicator(horizontalHeader()->sortIndicatorSection(), horizontalHeader()->sortIndicatorOrder()); +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + // in Qt4, the line above emits sortIndicatorChanged + // in Qt5, we need to call it manually, which triggers finally the select() + doSortByColumn(horizontalHeader()->sortIndicatorSection()); +#endif } else { // No saved order is present. Use the TrackModel's default sort order. int sortColumn = trackModel->defaultSortColumn(); @@ -372,8 +376,13 @@ void WTrackTableView::loadTrackModel(QAbstractItemModel *model) { while (sortColumn < 0 || trackModel->isColumnInternal(sortColumn)) { sortColumn++; } - // This line sorts the TrackModel and in turn generates a select() + // This line sorts the TrackModel horizontalHeader()->setSortIndicator(sortColumn, sortOrder); +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + // in Qt4, the line above emits sortIndicatorChanged + // in Qt5, we need to call it manually, which triggers finally the select() + doSortByColumn(sortColumn); +#endif } } From 7ae7d33ca739f6c7f3250eb3dda182eddb39f627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 27 May 2018 01:36:25 +0200 Subject: [PATCH 2/2] fix double activate of the mixxx library feature --- src/library/sidebarmodel.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/library/sidebarmodel.cpp b/src/library/sidebarmodel.cpp index 22a93e2165..518277f640 100644 --- a/src/library/sidebarmodel.cpp +++ b/src/library/sidebarmodel.cpp @@ -252,11 +252,7 @@ void SidebarModel::slotPressedUntilClickedTimeout() { void SidebarModel::pressed(const QModelIndex& index) { stopPressedUntilClickedTimer(); if (index.isValid()) { - if (index.internalPointer() == this) { - m_sFeatures[index.row()]->activate(); - } else { - startPressedUntilClickedTimer(index); - } + startPressedUntilClickedTimer(index); } }