Skip to content

Commit

Permalink
Tracks table: avoid wrong pre-selection with no tracks selected previ…
Browse files Browse the repository at this point in the history
…ously
  • Loading branch information
ronso0 committed Nov 20, 2023
1 parent 3223a75 commit 0292516
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/widget/wlibrarytableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ constexpr int kModelCacheSize = 1000;
WLibraryTableView::WLibraryTableView(QWidget* parent,
UserSettingsPointer pConfig)
: QTableView(parent),
m_prevRow(0),
m_prevColumn(0),
m_prevRow(-1),
m_prevColumn(-1),
m_pConfig(pConfig),
m_modelStateCache(kModelCacheSize) {
// Setup properties for table
Expand Down Expand Up @@ -212,8 +212,8 @@ void WLibraryTableView::restoreCurrentIndex(const QModelIndex& index) {
pSelectionModel->setCurrentIndex(idx, QItemSelectionModel::NoUpdate);
scrollTo(idx);
}
m_prevRow = 0;
m_prevColumn = 0;
m_prevRow = -1;
m_prevColumn = -1;
}

void WLibraryTableView::setTrackTableFont(const QFont& font) {
Expand Down
2 changes: 1 addition & 1 deletion src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void WTrackTableView::loadTrackModel(QAbstractItemModel* model, bool restoreStat
// tableview is focused -- and would not restore the previous style when
// it's unfocused. This can not be overwritten with qss, so it can screw up
// the skin design. Also, due to selectionModel()->selectedRows() it is not
// even useful to highlight the focused column because all colmsn are highlighted.
// even useful to indicate the focused column because all columns are highlighted.
header->setHighlightSections(false);
header->setSortIndicatorShown(m_sorting);
header->setDefaultAlignment(Qt::AlignLeft);
Expand Down

0 comments on commit 0292516

Please sign in to comment.