aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qquickworkerscript.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-21 10:41:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 07:13:18 +0000
commit499ec43937e926e4f2fa57a9baa455fcb3862262 (patch)
tree206c90d47387f8322b68f5e3db613189397e1af3 /src/qml/types/qquickworkerscript.cpp
parent53d1e9ed21d25e65a2f13606af479838f5f21fe7 (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/types/qquickworkerscript.cpp')
-rw-r--r--src/qml/types/qquickworkerscript.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index 32c0c86ff6..80c2d3a4bc 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -203,7 +203,7 @@ private:
QQuickWorkerScriptEnginePrivate::WorkerEngine::WorkerEngine(QQuickWorkerScriptEnginePrivate *parent)
: QV8Engine(nullptr, new QV4::ExecutionEngine), p(parent)
#if QT_CONFIG(qml_network)
-, accessManager(0)
+, accessManager(nullptr)
#endif
{
m_v4Engine->v8Engine = this;
@@ -290,7 +290,7 @@ QNetworkAccessManager *QQuickWorkerScriptEnginePrivate::WorkerEngine::networkAcc
#endif
QQuickWorkerScriptEnginePrivate::QQuickWorkerScriptEnginePrivate(QQmlEngine *engine)
-: workerEngine(0), qmlengine(engine), m_nextId(0)
+: workerEngine(nullptr), qmlengine(engine), m_nextId(0)
{
}
@@ -507,7 +507,7 @@ QQuickWorkerScriptEngine::~QQuickWorkerScriptEngine()
}
QQuickWorkerScriptEnginePrivate::WorkerScript::WorkerScript()
-: id(-1), initialized(false), owner(0)
+: id(-1), initialized(false), owner(nullptr)
{
}
@@ -534,7 +534,7 @@ void QQuickWorkerScriptEngine::removeWorkerScript(int id)
{
QQuickWorkerScriptEnginePrivate::WorkerScript* script = d->workers.value(id);
if (script) {
- script->owner = 0;
+ script->owner = nullptr;
QCoreApplication::postEvent(d, new WorkerRemoveEvent(id));
}
}
@@ -565,7 +565,7 @@ void QQuickWorkerScriptEngine::run()
qDeleteAll(d->workers);
d->workers.clear();
- delete d->workerEngine; d->workerEngine = 0;
+ delete d->workerEngine; d->workerEngine = nullptr;
}
@@ -616,7 +616,7 @@ void QQuickWorkerScriptEngine::run()
{Threaded ListModel Example}
*/
QQuickWorkerScript::QQuickWorkerScript(QObject *parent)
-: QObject(parent), m_engine(0), m_scriptId(-1), m_componentComplete(true)
+: QObject(parent), m_engine(nullptr), m_scriptId(-1), m_componentComplete(true)
{
}
@@ -696,7 +696,7 @@ QQuickWorkerScriptEngine *QQuickWorkerScript::engine()
QQmlEngine *engine = qmlEngine(this);
if (!engine) {
qWarning("QQuickWorkerScript: engine() called without qmlEngine() set");
- return 0;
+ return nullptr;
}
m_engine = QQmlEnginePrivate::get(engine)->getWorkerScriptEngine();
@@ -707,7 +707,7 @@ QQuickWorkerScriptEngine *QQuickWorkerScript::engine()
return m_engine;
}
- return 0;
+ return nullptr;
}
void QQuickWorkerScript::componentComplete()