Review Request 115148: Add KWINDOWSYSTEM_ namespace to HAVE_FOO defines

Martin Gräßlin mgraesslin at kde.org
Mon Jan 27 07:49:49 UTC 2014



> On Jan. 27, 2014, 8:36 a.m., Kevin Ottens wrote:
> > Why not... makes me want to ask the same for the other HAVE_FOO we have in the other frameworks. You might have opened the pandora box. :-)

yes the same reasoning applies to all frameworks. Though one could also say that using a HAVE_FOO in a public header is clearly wrong and the API needs fixing ;-) (That's certainly the case in KWindowSystem)

This change could break downstream usages as we often got the HAVE_X11 through kwindowsystem. So if we have something like:

#include <kwindowsystem.h>

#if HAVE_X11
KWindowsystem::foo();
#endif

it would break. It's obviously wrong, but some usages of Q_WS_X11 got fast ported to HAVE_X11 and it continued to compile thanks to the kwindowsystem include. (In such a pattern also having the ifdef at all is wrong, but also this is quite common that KWindowsystem is incorrectly wrapped around ifdef)


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115148/#review48343
-----------------------------------------------------------


On Jan. 26, 2014, 6:36 p.m., Alex Merry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115148/
> -----------------------------------------------------------
> 
> (Updated Jan. 26, 2014, 6:36 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kwindowsystem
> 
> 
> Description
> -------
> 
> Add KWINDOWSYSTEM_ namespace to HAVE_FOO defines
> 
> config-kwindowsystem.h is installed and included by public headers, so
> it should not define things as generic as "HAVE_X11", which are likely
> to also be defined by users of the framework.
> 
> 
> Diffs
> -----
> 
>   src/netwm.cpp 266afccaf111e6707493b18dad1d9c03dde1d912 
>   src/netwm.h aee6cea5e3b65cf6252b50515e4920cb9c96f240 
>   src/kxerrorhandler.cpp 612e62a345ec9c8503bab9fb12afa08426974828 
>   src/kxerrorhandler_p.h ad670fec6ff35e1c9df81b91517c02e6e0893ad1 
>   src/kxmessages.h 5d57e06d702afb5ceaed05de97ca40116b7f3aa3 
>   src/kxmessages.cpp b409ef2114c18190188ba5503d2f357bd9336e76 
>   src/kxutils.cpp e47ba68c08a14597e49fd33901b0a7c079924112 
>   src/kxutils_p.h 1e229801aac929bc596685dbfa5260d55d0f5298 
>   src/kusertimestamp.cpp de8ca61e7e9dd0ae9492ccf61883560d80501e2b 
>   src/kstartupinfo.cpp 5dbf47cb666fbed17c943491efe93e17f27d581e 
>   src/kkeyserver.h 8869fe7331e98846183ab37814b1d95e75ab9647 
>   src/config-kwindowsystem.h.cmake 58949d87f4254531ba57de86b6303cba05053222 
>   src/CMakeLists.txt b453af11a46615ecd94911f0d2f86922087bde0e 
>   CMakeLists.txt 2479237e574e86c9094b557dfa146c85b7b19b65 
>   src/kwindoweffects.cpp 91ef52f149a781df9308bb1587629dbaaf571b8e 
>   src/kwindoweffects_p.h 266b5f3e7f24bdca6ce467138ee067335225da78 
>   src/kwindowsystem.h 5bcfd062dcca42d282b70d0683d4ee1da88cc814 
>   src/kwindowsystem_x11.cpp 8634240cabc708a608277b34f21c41cee295e48a 
> 
> Diff: https://git.reviewboard.kde.org/r/115148/diff/
> 
> 
> Testing
> -------
> 
> Clean configure-build-test-install on a system with X11.  KWindowSystem already failed to build on a non-windows, non-mac system when X11 is not found (one of the tests fails to link if you comment out the find_package(X11) calls, as KWindowSystem::activeWindow() is never defined).
> 
> 
> Thanks,
> 
> Alex Merry
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140127/db23cb87/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list