diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-21 10:41:54 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-26 07:13:18 +0000 |
commit | 499ec43937e926e4f2fa57a9baa455fcb3862262 (patch) | |
tree | 206c90d47387f8322b68f5e3db613189397e1af3 /src/qml/qml/ftw/qqmlthread.cpp | |
parent | 53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff) |
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/ftw/qqmlthread.cpp')
-rw-r--r-- | src/qml/qml/ftw/qqmlthread.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp index cae7088840..78b477b472 100644 --- a/src/qml/qml/ftw/qqmlthread.cpp +++ b/src/qml/qml/ftw/qqmlthread.cpp @@ -123,7 +123,7 @@ bool QQmlThreadPrivate::MainObject::event(QEvent *e) QQmlThreadPrivate::QQmlThreadPrivate(QQmlThread *q) : q(q), m_threadProcessing(false), m_mainProcessing(false), m_shutdown(false), - m_mainThreadWaiting(false), mainSync(0), m_mainObject(this) + m_mainThreadWaiting(false), mainSync(nullptr), m_mainObject(this) { setObjectName(QStringLiteral("QQmlThread")); } @@ -155,7 +155,7 @@ void QQmlThreadPrivate::mainEvent() m_mainProcessing = true; while (!mainList.isEmpty() || mainSync) { - bool isSync = mainSync != 0; + bool isSync = mainSync != nullptr; QQmlThread::Message *message = isSync?mainSync:mainList.takeFirst(); unlock(); @@ -165,7 +165,7 @@ void QQmlThreadPrivate::mainEvent() lock(); if (isSync) { - mainSync = 0; + mainSync = nullptr; wakeOne(); } } @@ -328,7 +328,7 @@ void QQmlThread::internalCallMethodInThread(Message *message) message->call(this); delete message; lock(); - d->mainSync = 0; + d->mainSync = nullptr; wakeOne(); } else { d->wait(); @@ -345,7 +345,7 @@ void QQmlThread::internalCallMethodInMain(Message *message) d->lock(); - Q_ASSERT(d->mainSync == 0); + Q_ASSERT(d->mainSync == nullptr); d->mainSync = message; if (d->m_mainThreadWaiting) { @@ -359,7 +359,7 @@ void QQmlThread::internalCallMethodInMain(Message *message) while (d->mainSync) { if (d->m_shutdown) { delete d->mainSync; - d->mainSync = 0; + d->mainSync = nullptr; break; } d->wait(); @@ -405,7 +405,7 @@ void QQmlThread::waitForNextMessage() message->call(this); delete message; lock(); - d->mainSync = 0; + d->mainSync = nullptr; wakeOne(); } else { d->wait(); |