BaseSqlTableModel: Fix bounds check #11499
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #11491, i.e. fixes the sorting for certain columns (e.g. BPM).
I hope this solution is also semantically correct, since I don't have a super deep understanding of the different indexing schemes (sort columns vs column indices etc.).
From what I understand, the issue was that the table columns (
track_id
,position
,preview
) weren't considered and then caused the bound check to fail. This was particularly an issue for columns such as BPM and rating since they have a rather high index and thus fell outside the range of the 3 track table columns that weren't considered:Once
m_sortColumns
was populated (which happens on the first sort), the bound check 'accidentally' passed since the previously out-of-bounds column indices were suddenly in bounds. This is also why sorting by a key such as title or artist would 'fix' the BPM sorting issue.This should hopefully resolve the issue both for iTunes and Traktor (and perhaps other external) playlists.