Skip to content

(fix) Controller I/O table: sort Action column by display string - #13039

Merged
daschuer merged 1 commit into
mixxxdj:2.4from
ronso0:controller-io-sort-by-displaytext
Apr 21, 2024
Merged

(fix) Controller I/O table: sort Action column by display string#13039
daschuer merged 1 commit into
mixxxdj:2.4from
ronso0:controller-io-sort-by-displaytext

Conversation

@ronso0

@ronso0 ronso0 commented Apr 2, 2024

Copy link
Copy Markdown
Member

Addresses an old TODO and fixes #13036

@ronso0
ronso0 changed the base branch from main to 2.4 April 2, 2024 14:14
@ronso0 ronso0 changed the title Controller I/O table: sort Action column by display string (fix) Controller I/O table: sort Action column by display string Apr 2, 2024
@ronso0

ronso0 commented Apr 4, 2024

Copy link
Copy Markdown
Member Author

This clang-format fix is nonsense:

                     VERIFY_OR_DEBUG_ASSERT(del) {
-                        return QString();
+                    return QString();
                     }

I ignored it locally because I thought it was a false-positive of my version or whatever.

Comment on lines 213 to 223
case MIDI_COLUMN_ACTION:
if (role == Qt::UserRole) {
// TODO(rryan): somehow get the delegate display text?
return QVariant(mapping.control.group + QStringLiteral(",") + mapping.control.item);
if (role == Qt::UserRole) { // sort by displaystring
QStyledItemDelegate* del = getDelegateForIndex(index);
VERIFY_OR_DEBUG_ASSERT(del) {
return QString();
}
return del->displayText(QVariant::fromValue(mapping.control), QLocale());
}
return QVariant::fromValue(mapping.control);
case MIDI_COLUMN_COMMENT:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I ignored it locally because I thought it was a false-positive of my version or whatever.

maybe it goes away when you wrap the case block in another pair of braces?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah okay, you think clang expects all returns of a case to be indented identically?
I'll try that, but tbh I'm a bit tired of making clang-format happy with previously unrequired formatting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah okay, you think clang expects all returns of a case to be indented identically?

Nah, the syntax rules about switch-case is just a bit weird in general, so I just think this is bug in clang format which might be worked around that way.

I'll try that, but tbh I'm a bit tired of making clang-format happy with previously unrequired formatting.

I agree. I mean I wouldn't want to go without clang-format though so I usually just do what makes it happy, even if I don't agree with it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Whatever it takes, just make it happy even if its accepting the garbage it produces. Introducing a CI failure deliberately is not worth the potential hassle later.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👍

@ronso0
ronso0 force-pushed the controller-io-sort-by-displaytext branch from d8f27b3 to 0c116b7 Compare April 5, 2024 11:04
@ronso0

ronso0 commented Apr 6, 2024

Copy link
Copy Markdown
Member Author

Merge?

@Swiftb0y

Swiftb0y commented Apr 7, 2024

Copy link
Copy Markdown
Member

I'm sorry I don't mean to reiterate, but I think we should just accept the bogus clang-format suggestion because I don't want to merge this PR unless its green. Merging a failing PR would probably have annoying effects later (much more than a misformatted line). So can you please apply the pre-commit patch, amend and force push?

@ronso0

ronso0 commented Apr 7, 2024

Copy link
Copy Markdown
Member Author

Oh, sorry.
Locally it passed with the extra {} so I didn't check CI.
But here clang insist on the indentation 🤷

Will fix it.

@ronso0
ronso0 force-pushed the controller-io-sort-by-displaytext branch from 0c116b7 to 5c05c76 Compare April 7, 2024 14:33
@ronso0 ronso0 added this to the 2.4.1 milestone Apr 10, 2024
@daschuer

Copy link
Copy Markdown
Member

@Swiftb0y This looks good now, merge?

@ronso0

ronso0 commented Apr 18, 2024

Copy link
Copy Markdown
Member Author

friendly pinging @Swiftb0y

@daschuer daschuer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can merge this now. @Swiftb0y If you find time for a review. We may fix the findings after merge.

@daschuer
daschuer merged commit 3b8288f into mixxxdj:2.4 Apr 21, 2024
@ronso0
ronso0 deleted the controller-io-sort-by-displaytext branch April 21, 2024 19:04
@Swiftb0y

Copy link
Copy Markdown
Member

sorry for not responding earlier, this got lost among the flood of notifications. lgtm indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MIDI table: order of rows wonky

3 participants