aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.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/qml/qqmljavascriptexpression.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/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index cd35ab93c6..74148e3ca4 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -93,12 +93,12 @@ void QQmlDelayedError::catchJavaScriptException(QV4::ExecutionEngine *engine)
QQmlJavaScriptExpression::QQmlJavaScriptExpression()
- : m_error(0),
- m_context(0),
- m_prevExpression(0),
- m_nextExpression(0),
- m_v4Function(0),
- m_sourceLocation(0)
+ : m_error(nullptr),
+ m_context(nullptr),
+ m_prevExpression(nullptr),
+ m_nextExpression(nullptr),
+ m_v4Function(nullptr),
+ m_sourceLocation(nullptr)
{
}
@@ -114,7 +114,7 @@ QQmlJavaScriptExpression::~QQmlJavaScriptExpression()
clearPermanentGuards();
clearError();
if (m_scopeObject.isT2()) // notify DeleteWatcher of our deletion.
- m_scopeObject.asT2()->_s = 0;
+ m_scopeObject.asT2()->_s = nullptr;
delete m_sourceLocation;
}
@@ -157,8 +157,8 @@ void QQmlJavaScriptExpression::setContext(QQmlContextData *context)
*m_prevExpression = m_nextExpression;
if (m_nextExpression)
m_nextExpression->m_prevExpression = m_prevExpression;
- m_prevExpression = 0;
- m_nextExpression = 0;
+ m_prevExpression = nullptr;
+ m_nextExpression = nullptr;
}
m_context = context;
@@ -211,7 +211,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, b
QQmlPropertyCapture capture(m_context->engine, this, &watcher);
QQmlPropertyCapture *lastPropertyCapture = ep->propertyCapture;
- ep->propertyCapture = notifyOnValueChanged() ? &capture : 0;
+ ep->propertyCapture = notifyOnValueChanged() ? &capture : nullptr;
if (notifyOnValueChanged())
@@ -253,7 +253,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, b
for (int ii = 0; ii < capture.errorString->count(); ++ii)
qWarning("%s", qPrintable(capture.errorString->at(ii)));
delete capture.errorString;
- capture.errorString = 0;
+ capture.errorString = nullptr;
}
while (QQmlJavaScriptExpressionGuard *g = capture.guards.takeFirst())
@@ -274,7 +274,7 @@ void QQmlPropertyCapture::captureProperty(QQmlNotifier *n, Duration duration)
while (!guards.isEmpty() && !guards.first()->isConnected(n))
guards.takeFirst()->Delete();
- QQmlJavaScriptExpressionGuard *g = 0;
+ QQmlJavaScriptExpressionGuard *g = nullptr;
if (!guards.isEmpty()) {
g = guards.takeFirst();
g->cancelNotify();
@@ -323,7 +323,7 @@ void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, Duration dur
while (!guards.isEmpty() && !guards.first()->isConnected(o, n))
guards.takeFirst()->Delete();
- QQmlJavaScriptExpressionGuard *g = 0;
+ QQmlJavaScriptExpressionGuard *g = nullptr;
if (!guards.isEmpty()) {
g = guards.takeFirst();
g->cancelNotify();