-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Replace deprecated QSignalMapper with lambda expressions #2427
Conversation
Oh, the CI builds failed because we need at least Qt 5.6 to use lambdas with |
aaa29fa
to
d38ef93
Compare
@daschuer I fixed the remaining issues (hopefully) and also deduplicated the |
Mmm .. rebasing a 500 lines a PR under review does not work well, because instead of reading your fixes, I now have to read everything again. Rebasing und review should only be done after talking to the reviewer. |
Ah, nevermind. It is not too bad. I hope I find time to have a look and manual test. |
Sorry I just fixed up the last two commits that you didn't review yet anyway. |
IMHO rebasing is a viable option for technical PRs like this one that suffer from our broad range of supported platforms and versions. Otherwise we would need to mark each opened PR by default as work-in-progress until all CI builds succeeded. Without rebasing there would be intermediate versions that don't build successfully. |
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.
We should avoid to use std::unique_ptr for objects that are already managed by Qt.
Yes indeed, that is a very good reason for debasing a PR. In this case I was probably complaining unjustified. Also, in a case we have only one faulty HEAD commit with no usable change else, a rebase of this single commit is also a good thing. Just keep in mind the extra review effort before deciding for a rebase. |
The failure of the Windows build on AppVeyor is unrelated. |
Ping @daschuer |
I like to do manual test before merge. |
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.
I have added some optional minor comments. The PR looks good. Will test tonight.
|
||
if (addReset) { | ||
QString resetMenuTitle = QString("%1 (%2)").arg(controlTitle, m_resetStr); | ||
QString resetMenuDescription = QString("%1 (%2)").arg(controlDescription, m_resetStr); | ||
QString resetTitle = QString("%1 (%2)").arg(title, m_resetStr); |
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.
Here and nelow, we can make use of QStringBuilder and QStringLiteral:
Titel + QStringLiteral (" (") + m_resetStr + QChar(')');
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.
Is this giving more performance? Because I think it's less readable.
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.
Yes, because it does not create the intermediate "%1 (%2)" string from char[] and there is no string parsing for %. But readability is also a high value ... I don't mind.
[=](bool) { m_crateMapper.map(); }); | ||
int iCrateId = crate.getId().value(); | ||
connect(pAction.get(), &QAction::triggered, | ||
this, [this, iCrateId] { slotAddCrateToAutoDj(iCrateId); }); |
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.
This one does not work anymore ... but why?
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.
Never mind, master is also effected.
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.
I will file a bug
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.
Ups.. It is already there: https://bugs.launchpad.net/mixxx/+bug/1856405
Works and looks good now. Thank you very much. |
Adding tracks to crates through the check boxes in the context menu fails:
Maybe a regression? I haven't done a bisect yet. |
Maybe |
This fixes a bunch of
-Wdeprecated-declarations
warnings. Please review thorougly, I'm not that experienced with lambda expressions. ;-)