D24950: Drop some custom list typedefs
Vlad Zahorodnii
noreply at phabricator.kde.org
Fri Oct 25 19:28:38 BST 2019
zzag created this revision.
zzag added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
zzag requested review of this revision.
REVISION 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 get
"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.
REPOSITORY
R108 KWin
BRANCH
drop-custom-list-aliases
REVISION DETAIL
https://phabricator.kde.org/D24950
AFFECTED FILES
abstract_client.cpp
activation.cpp
activities.cpp
autotests/integration/activation_test.cpp
autotests/integration/stacking_order_test.cpp
composite.cpp
deleted.h
effects.cpp
geometry.cpp
group.cpp
group.h
input.cpp
keyboard_input.cpp
layers.cpp
placement.cpp
plugins/scenes/opengl/scene_opengl.cpp
plugins/scenes/opengl/scene_opengl.h
plugins/scenes/qpainter/scene_qpainter.cpp
plugins/scenes/qpainter/scene_qpainter.h
plugins/scenes/xrender/scene_xrender.cpp
plugins/scenes/xrender/scene_xrender.h
scene.cpp
scene.h
scripting/scripting_model.cpp
sm.cpp
tabbox/tabbox.cpp
toplevel.cpp
toplevel.h
useractions.cpp
utils.h
workspace.cpp
workspace.h
x11client.cpp
x11client.h
To: zzag, #kwin
Cc: kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20191025/28dd97cc/attachment.html>
More information about the kwin
mailing list