Few are left as they are with code which needs further analysis
and posssibly fixes
Details
- Reviewers
cfeck dhaumann - Group Reviewers
Frameworks - Commits
- R236:549fc06ffa21: Bulk port away from foreach
Tests still pass, all widgets quickly tested in occurences.
Diff Detail
- Repository
- R236 KWidgetsAddons
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
I think the patch is fine: +1
Please address/comment on fir :) besides that, another review won't hurt, since you simplify the code in 1-2 places, i.e. the changes are slightly more than just the transition to for.
src/fonthelpers.cpp | ||
---|---|---|
97–101 | Optionally, you could even write: static const auto genericNames = { QLatin1String("..."), ... }; This initializer list will then even not require any memory allocation. You don't have.contains() later, though... You'd need to simply use std::find() semantics. | |
src/kfontsizeaction.cpp | ||
93 | Imho here qAsConst(actions()) would be nicer to avoid this->. | |
src/kviewstateserializer.h | ||
134 | I think fir does not compile, does it? |
Thanks for review @dhaumann :) Well, if you like I can give KTextEditor a try, motivated there with my KDevelop hat on :) Let's see when I am sleepless at the computer next time ;)
src/fonthelpers.cpp | ||
---|---|---|
97–101 | Yes, it was the contains() which was my motivation here to stay with QStringList. | |
src/kfontsizeaction.cpp | ||
93 | Will test is this works, but IIRC actions() returned a normal left-side value thingie, which qAsConst does not want to take. | |
src/kviewstateserializer.h | ||
134 | That was... left as exercise for the person copying the code from the docs ;) Alright, not. Well spotted. |
autotests/kacceleratormanagertest.cpp | ||
---|---|---|
35 | Please use KF5 coding style: Type *var instead of Type* var (also for & references), |
src/kfontsizeaction.cpp | ||
---|---|---|
93 | Yes, qAsConst(actions()) does not work, as actions() is a r-value type, which qAsConst does not take (move overload of qAsConst explicitly deleted), following std::as_const here, to not run into dangling pointers. |
Thanks. In any case, would wait for after 5.62 tagging/branching, as by experience there still might be one or the other regression slipped in with porting from foreach, so having some weeks of testing from more people running git master makes me feel better, before this gets rolled to the masses :)
btw, already started to do the same to ktexteditor, so in some days you kate devs shall enjoy the review of a similar patch...