qtkeychain
qtkeychain copied to clipboard
Use better Q_NULLPTR.
This will be the official Qt way.
It there is an official Qt way, it would be to use nullptr
now.
(But I think currently, qtkeychain still does not require C++11. But I think it would make sense to require it)
Q_NULLPTR
is not compatible with Qt4. Don't know if it's of any importance nowadays but right now latest QtKeychain appears to be buildable with Qt4. It would no longer be if this PR is accepted, at least in its current state. Even if it's ok to drop the support for Qt4 now, it should be done properly: for one thing, the option to build with Qt4 should be removed from CMakeLists.txt
.
Qt4 it out of support since 2015 from vendor. So I think the support of it here can also be dropped. Using nullptr has the problem that not all compiler support it. So the Q_NULLPTR will use nullptr for compiler that support it and null(not 0) for the rest. See the details for it in the file qcompilerdetection.h of the source code of Qt.
As long as there's no strong reason to drop Qt 4 support, I will keep it. One could create a local version of the macro that also works for Qt 4, but that's probably not worth the effort.