[KWayland] Port away from deprecated API in Qt 5.14
ClosedPublic

Authored by dfaure on Sep 17 2019, 3:45 AM.

Diff Detail

Repository
R127 KWayland
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 16675
Build 16693: arc lint + arc unit
dfaure created this revision.Sep 17 2019, 3:45 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 17 2019, 3:45 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
dfaure requested review of this revision.Sep 17 2019, 3:45 AM
zzag added inline comments.Sep 17 2019, 7:27 AM
autotests/client/test_wayland_surface.cpp
395–396

I know it's unrelated, but erasing smart pointer types perhaps is not the greatest idea. Could you please use concrete type instead of auto while you're on this?

src/client/region.cpp
62

Heh, you could make it a bit simpler:

for (const QRect &rect : region) {
    ...
}
src/server/surface_interface_p.h
27–28

Keep includes sorted please.

dfaure marked 3 inline comments as done.Sep 17 2019, 11:36 AM
dfaure added inline comments.
autotests/client/test_wayland_surface.cpp
395–396

The "Almost Always Auto" crowd would disagree with you, but sure, your choice. Done.

src/client/region.cpp
62

Heh indeed. I looked at the API, saw begin/end, used begin/end.... I forgot that this means range-for is available too :)

dfaure updated this revision to Diff 66290.Sep 17 2019, 11:37 AM
dfaure marked 2 inline comments as done.

Less auto, more range-for, sorting includes

zzag accepted this revision.Sep 17 2019, 12:12 PM
zzag added inline comments.
autotests/client/test_wayland_surface.cpp
395–396

Putting auto everywhere is a terrible thing! Surely it makes refactoring a bit easier, however you kill readability by erasing types.

Qt has a really good auto keyword usage guideline. https://wiki.qt.io/Coding_Conventions#auto_Keyword

This revision is now accepted and ready to land.Sep 17 2019, 12:12 PM
dfaure closed this revision.Sep 17 2019, 12:20 PM