diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2018-07-14 08:44:58 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2018-07-30 10:57:48 +0000 |
commit | 754b2b21b0ce0e435ddc3c8ddce3bd6e12915f96 (patch) | |
tree | a7704a68b10d3700a10d3f4b7553bbfc47c50cb2 | |
parent | 9d13c38a0c316a347c4c901e1ba1c6306cd824f3 (diff) | |
download | qtx11extras-754b2b21b0ce0e435ddc3c8ddce3bd6e12915f96.tar.gz |
Use nullptr and shared null
Relying on the implicit cast for QByteArray from 0 actually does not
result in returning sharedNull and is confusing to read.
Change-Id: I0aeef058e9f15b9fe5a53a7ed93f378bc2c74b96
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
-rw-r--r-- | src/x11extras/qx11info_x11.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/x11extras/qx11info_x11.cpp b/src/x11extras/qx11info_x11.cpp index f503509..77caca7 100644 --- a/src/x11extras/qx11info_x11.cpp +++ b/src/x11extras/qx11info_x11.cpp @@ -310,10 +310,10 @@ unsigned long QX11Info::getTimestamp() QByteArray QX11Info::nextStartupId() { if (!qApp) - return 0; + return QByteArray(); QPlatformNativeInterface *native = qApp->platformNativeInterface(); if (!native) - return 0; + return QByteArray(); return static_cast<char *>(native->nativeResourceForIntegration("startupid")); } @@ -352,10 +352,10 @@ void QX11Info::setNextStartupId(const QByteArray &id) Display *QX11Info::display() { if (!qApp) - return NULL; + return nullptr; QPlatformNativeInterface *native = qApp->platformNativeInterface(); if (!native) - return NULL; + return nullptr; void *display = native->nativeResourceForIntegration(QByteArray("display")); return reinterpret_cast<Display *>(display); @@ -369,10 +369,10 @@ Display *QX11Info::display() xcb_connection_t *QX11Info::connection() { if (!qApp) - return NULL; + return nullptr; QPlatformNativeInterface *native = qApp->platformNativeInterface(); if (!native) - return NULL; + return nullptr; void *connection = native->nativeResourceForIntegration(QByteArray("connection")); return reinterpret_cast<xcb_connection_t *>(connection); |