Remove usage of QWeakPointer for QObject
ClosedPublic

Authored by gladhorn on Aug 10 2019, 8:35 AM.

Details

Reviewers
zzag
Group Reviewers
KWin
Summary

This usage of QWeakPointer has been deprecated since Qt 5.0, since it
leads to really confusing API - usually you must never dereference a
QWeakPointer directly, but always go through QSharedPointer, except in
this one case, where it's permissible.

Use QPointer instead, which is clean.
Only keep the QPointer where the object in question may get deleted,
while in the API where it has to be valid, use a regular pointer.

Initializing the pointer explicitly to nullptr makes no sense.

Diff Detail

Repository
R108 KWin
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 14936
Build 14954: arc lint + arc unit
gladhorn created this revision.Aug 10 2019, 8:35 AM
Restricted Application added a project: KWin. · View Herald TranscriptAug 10 2019, 8:35 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
gladhorn requested review of this revision.Aug 10 2019, 8:35 AM
zzag accepted this revision.Aug 10 2019, 9:07 AM
zzag added a subscriber: zzag.

Thanks.

useractions.cpp
134

Align * to right.

This revision is now accepted and ready to land.Aug 10 2019, 9:07 AM
gladhorn closed this revision.Aug 10 2019, 9:20 AM
gladhorn marked an inline comment as done.

https://commits.kde.org/kwin/9002f9b99eacb2ea6ba66bbaa39a1209ce18db4b - the arc command line tool confused me yet again... sorry.