-
Notifications
You must be signed in to change notification settings - Fork 238
Add version sorting using CMappedTreeWidgetItem #3557
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
Conversation
5a99f2a to
9773ee1
Compare
It's hard to be exact, as it varies between platforms. The main part of the version, and the alpha/beta/rc will be visible. Someone who is particularly interested in the dev commit numbers can always widen the field manually. It's no big deal to me either way. |
The suffixes alpha, beta and rc sort before the bare version number (due to the <, =, > flag after the patch number), other suffixes sort after. I'm using the same technique as I did for Jamulus Explorer. For the order of alpha, beta and rc, it just so happens that alphabetical order corresponds with the order they happen. Just so long as we don't go beyond alpha9, beta9 or rc9, which is unlikely! |
|
Like I say, we could have alpha1, beta1, rc1 and then had to go back and do beta2 and beta3 before rc2. Not a big deal, though. (Switching in the git commit timestamp is now pretty easy, with the work here.) |
| { | ||
| x = "="; // bare version number | ||
| } | ||
| else if ( suffix.startsWith ( "rc" ) || suffix.startsWith ( "beta" ) || suffix.startsWith ( "alpha" ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Document somewhere on the release docs that the application actually filters based on these suffixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not so much a filter. All suffixes are shown. It's just that alpha, beta and rc sort before the base version, and all other suffixes sort after. I agree it's worth documenting somewhere suitable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a reminder in one of COMPILING.md or CONTRIBUTING.md -- or a comment at the top of Jamulus.pro perhaps.


Short description of changes
Corrects the sorting of the version column in the connect dialog when using --showallservers.
It does this by mapping the version number to a sortable text field and storing that in the
datafield of the widget item.It also subclasses
QTreeWidgetItemasCMappedTreeWidgetItemin order to provide an override foroperator<to sort on the
datafield instead of thetextfield.Also increases the default column width for the version column.
CHANGELOG: Client: Fix sorting of version number in connect dialog with --showallservers
Context: Fixes an issue?
Fixes: #3542
Does this change need documentation? What needs to be documented and how?
No, it's just a bugfix.
Status of this Pull Request
Tested on RPi Linux. Ready for testing on other platforms.
What is missing until this pull request can be merged?
Review.
Checklist