Drop some custom list typedefs
ClosedPublic

Authored by zzag on Oct 25 2019, 6:28 PM.

Details

Reviewers
None
Group Reviewers
KWin
Commits
R108:9d4a32596cd3: Drop some custom list typedefs
Summary

Qt has its own thing where a type might also have corresponding list
alias, e.g. QObject and QObjectList, QWidget and QWidgetList. I don't
know why Qt does that, maybe for some historical reasons, but what
matters is that we copy this pattern here in KWin. While this pattern
might be useful with some long list types, for example

QList<QWeakPointer<TabBoxClient>> TabBoxClientList

in general, it causes more harm than good. For example, we've got two
new client types, do we need corresponding list typedefs for them? If
no, why do we have ClientList and so on?

Another problem with these typedefs is that you need to include utils.h
header in order to use them. A better way to handle such things is to
just forward declare a client class (if that's possible) and use it
directly with QList or QVector. This way translation units don't become
"bloated" with utils.h stuff for no apparent reason.

So, in order to make code more consistent and easier to follow, this
change drops some of our custom typedefs. Namely ConstClientList,
ClientList, DeletedList, UnmanagedList, ToplevelList, and GroupList.

Test Plan

Compiles.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Oct 25 2019, 6:28 PM
Restricted Application added a project: KWin. · View Herald TranscriptOct 25 2019, 6:28 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Oct 25 2019, 6:28 PM
zzag edited the summary of this revision. (Show Details)Oct 25 2019, 6:39 PM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 27 2019, 2:09 PM
This revision was automatically updated to reflect the committed changes.