Apply some C++11 niceties, styling consistency
ClosedPublic

Authored by Kanedias on Jan 10 2018, 8:56 PM.

Details

Summary

I've noticed some override statements in the code, so I think
it may be safely assumed that we're at least compiling in C++11
mode.

Fixed override/nullptr/default usages, fixed some spacing
style problems

Diff Detail

Repository
R858 Qt Quick Controls 2: Desktop Style
Branch
c++11
Lint
No Linters Available
Unit
No Unit Test Coverage
Kanedias created this revision.Jan 10 2018, 8:56 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 10 2018, 8:56 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Kanedias requested review of this revision.Jan 10 2018, 8:56 PM
Kanedias updated this revision to Diff 25123.Jan 10 2018, 8:59 PM

Apply some C++11 niceties, styling consistency

Kanedias edited the summary of this revision. (Show Details)Jan 10 2018, 9:00 PM
apol added a subscriber: apol.Jan 11 2018, 2:15 AM
apol added inline comments.
kirigami-plasmadesktop-integration/plasmadesktoptheme.cpp
234–235

if you make it auto the initializer_list will be used not requiring the allocation AFAIU.
That said, I wonder if the compiler can unwind a foreach.

Kanedias added inline comments.Jan 11 2018, 7:01 PM
kirigami-plasmadesktop-integration/plasmadesktoptheme.cpp
234–235

I didn't quite get it, you mean we can write for (auto state : { QPalette::Active, QPalette::Inactive, QPalette::Disabled }) to get rid of allocation of states array?

apol added inline comments.Jan 12 2018, 12:50 AM
kirigami-plasmadesktop-integration/plasmadesktoptheme.cpp
234–235

Yes, or static const auto states = { QPalette::Active, QPalette::Inactive, QPalette::Disabled };
Shouldn't be much of a difference.

Kanedias updated this revision to Diff 25198.Jan 12 2018, 6:58 AM

Fix palette array allocation

Kanedias marked 3 inline comments as done.Jan 12 2018, 6:59 AM

Will update this today with changes from caching by Alex

mart accepted this revision.Jan 14 2018, 4:00 PM
This revision is now accepted and ready to land.Jan 14 2018, 4:00 PM
Kanedias closed this revision.Jan 14 2018, 4:26 PM