D6054: Use explicit flag values or explicit constructor instead of nullptr
Friedrich W. H. Kossebau
noreply at phabricator.kde.org
Thu Jun 1 00:50:56 UTC 2017
kossebau created this revision.
Restricted Application added projects: Plasma, Frameworks.
Restricted Application added subscribers: Frameworks, plasma-devel.
REVISION SUMMARY
The constructor of QFlags which was intended to handle literal "0"
as commonly used indicator of no-flags-set has been done with a
trick based on pointer types. Which these days of nullptr existing and
compilers pushing to use that sadly fired back and, instead of
allowing convenient code with commonly understood literal "0" values,
resulted in quite some code using "nullptr" to indicate a QFLags-based
type value with no flags set, which can be puzzling for humans
reading the code.
To improve the code again, instead of "nullptr" are used:
- enum item representing the 0=no-flag-set value, if existing
- explicit default constructor
REPOSITORY
R278 KWindowSystem
BRANCH
nonullptrforflagsplease
REVISION DETAIL
https://phabricator.kde.org/D6054
AFFECTED FILES
autotests/kstartupinfo_unittest.cpp
autotests/kwindowinfox11test.cpp
autotests/kwindowsystemx11test.cpp
autotests/netwininfotestwm.cpp
src/kstartupinfo.cpp
src/kwindowinfo.cpp
src/kwindowinfo.h
src/kwindowsystem.h
src/platforms/xcb/kwindowinfo.cpp
src/platforms/xcb/kwindowsystem.cpp
src/platforms/xcb/netwm.cpp
src/platforms/xcb/netwm.h
To: kossebau, #plasma, graesslin
Cc: plasma-devel, #frameworks, ZrenBot, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170601/28bfc7ee/attachment-0001.html>
More information about the Plasma-devel
mailing list