aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquickfolderlistmodel
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 /tests/auto/qml/qquickfolderlistmodel
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 'tests/auto/qml/qquickfolderlistmodel')
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
index 1a23286ede..1f1be122f1 100644
--- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
+++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
@@ -115,7 +115,7 @@ void tst_qquickfolderlistmodel::basicProperties()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
QCOMPARE(flm->property("nameFilters").toStringList(), QStringList() << "*.qml"); // from basic.qml
QCOMPARE(flm->property("folder").toUrl(), QUrl::fromLocalFile(QDir::currentPath()));
@@ -149,7 +149,7 @@ void tst_qquickfolderlistmodel::status()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
QTRY_COMPARE(flm->property("status").toInt(), int(Ready));
flm->setProperty("folder", QUrl::fromLocalFile(""));
QTRY_COMPARE(flm->property("status").toInt(), int(Null));
@@ -163,7 +163,7 @@ void tst_qquickfolderlistmodel::showFiles()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", dataDirectoryUrl());
QTRY_COMPARE(flm->property("count").toInt(), 8); // wait for refresh
@@ -181,7 +181,7 @@ void tst_qquickfolderlistmodel::resetFiltering()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", testFileUrl("resetfiltering"));
// _q_directoryUpdated may be triggered if model was empty before, but there won't be a rowsRemoved signal
@@ -203,7 +203,7 @@ void tst_qquickfolderlistmodel::nameFilters()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
connect(flm, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(removed(QModelIndex,int,int)));
@@ -235,7 +235,7 @@ void tst_qquickfolderlistmodel::refresh()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", dataDirectoryUrl());
QTRY_COMPARE(flm->property("count").toInt(),8); // wait for refresh
@@ -258,7 +258,7 @@ void tst_qquickfolderlistmodel::cdUp()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
const QUrl startFolder = flm->property("folder").toUrl();
QVERIFY(startFolder.isValid());
@@ -336,7 +336,7 @@ void tst_qquickfolderlistmodel::showDotAndDotDot()
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", folder);
flm->setProperty("rootFolder", rootFolder);
@@ -371,7 +371,7 @@ void tst_qquickfolderlistmodel::sortReversed()
QQmlComponent component(&engine, testFileUrl("sortReversed.qml"));
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
flm->setProperty("folder", dataDirectoryUrl());
QTRY_COMPARE(flm->property("count").toInt(), 9); // wait for refresh
QCOMPARE(flm->data(flm->index(0),FileNameRole).toString(), QLatin1String("txtdir"));
@@ -382,7 +382,7 @@ void tst_qquickfolderlistmodel::introspectQrc()
QQmlComponent component(&engine, testFileUrl("qrc.qml"));
checkNoErrors(component);
QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
- QVERIFY(flm != 0);
+ QVERIFY(flm != nullptr);
QTRY_COMPARE(flm->property("count").toInt(), 1); // wait for refresh
QCOMPARE(flm->data(flm->index(0),FileNameRole).toString(), QLatin1String("hello.txt"));
}