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 empty library table after start #3935

Merged
merged 6 commits into from Jun 4, 2021
Merged

Conversation

daschuer
Copy link
Member

@daschuer daschuer commented Jun 2, 2021

The issue was an invalid stored sort column, that prevents the initial select() call.
Now it falls back to either a default or the first column.

@github-actions github-actions bot added the ui label Jun 2, 2021
@ronso0
Copy link
Member

ronso0 commented Jun 2, 2021

So this fixes both
https://bugs.launchpad.net/mixxx/+bug/1924843
https://bugs.launchpad.net/mixxx/+bug/1930546
for you?

Can't test since I can't reproduce (with 2.3).

@ronso0
Copy link
Member

ronso0 commented Jun 2, 2021

Did you test both with a clean install and an upgrade from 2.2.x?

@daschuer
Copy link
Member Author

daschuer commented Jun 2, 2021

Yes, here is the result after a update from a clean 2.2.3 install
grafik

@ywwg
Copy link
Member

ywwg commented Jun 2, 2021

Who is a good person to review this? I am not up to speed with this issue

}

//saving current vertical bar position
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put spaces between // and words:
// Saving current vertical bar position
// using the address of the track model as key.

sortColumn++;
// sort, find the first valid sort column and sort by that.
int sortColumnIndex = -1;
constexpr int kMaxPobeIndex = 10; // just to avoid an endless while loop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "Pobe" mean? Instead of a magic number can you use the number of valid columns?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unknown here and there is no function to access this number.
The original code silently assumes that there is a valid column among the first few.
This is a safety net together with the ASSERT below.

@daschuer
Copy link
Member Author

daschuer commented Jun 2, 2021

Done

@ninomp
Copy link
Contributor

ninomp commented Jun 2, 2021

I just tested this and this solves the issue for me.

@ronso0 ronso0 added this to In progress in 2.3 release via automation Jun 3, 2021
@ronso0 ronso0 added this to the 2.3.0 milestone Jun 3, 2021
@ronso0 ronso0 moved this from In progress to Needs Review in 2.3 release Jun 3, 2021
}
DEBUG_ASSERT(sortColumn != TrackModel::SortColumnId::Invalid);
Copy link
Contributor

@uklotzde uklotzde Jun 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a debug assert is wrong, because it will trigger when reaching kMaxProbeIndex, which is possible.

Why do you need an artificial constant instead of using model()->columnCount() as the upper limit?

@daschuer
Copy link
Member Author

daschuer commented Jun 3, 2021

Thank you for the hint. Fixed.

@ronso0
Copy link
Member

ronso0 commented Jun 3, 2021

@uklotzde Any chance this also fixes First activation of external playlist: Empty view for you?

while (sortColumn < 0 || trackModel->isColumnInternal(sortColumn)) {
sortColumn++;
// sort, find the first valid sort column and sort by that.
int sortColumnIndex = -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idiomatic implementation would be a simple for loop with a break statement.

@uklotzde
Copy link
Contributor

uklotzde commented Jun 4, 2021

Empty track table view of external playlist is fixed. I cannot reproduce the other issues, even when switching languages.

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM

@uklotzde uklotzde merged commit 5ae08b9 into mixxxdj:2.3 Jun 4, 2021
2.3 release automation moved this from Needs Review to Done Jun 4, 2021
@daschuer daschuer deleted the lp1930546 branch August 1, 2021 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2.3 release
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants