diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-12-03 13:36:49 +0100 |
---|---|---|
committer | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2019-11-05 16:32:28 +0000 |
commit | 2faccdf9a6586cb9b6f7bc276c39c814ab354003 (patch) | |
tree | 37d66e4634b07c92e9916822cb1bc02089c63c17 /tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp | |
parent | dbb54805f63f9ed68d84fe090d608872f16170d2 (diff) |
Don't insert multiple names for the same role
It doesn't make a lot of sense to have two names for the
same role. Use 'fileIcon' exclusively for the Qt::Decoration/
FileIconRole.
Change-Id: Icaa46ba4aa61efc56ba007a14bab5e59ea26cd35
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp')
-rw-r--r-- | tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index f910b12cc6..3f67b0e1b4 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -1048,7 +1048,7 @@ void tst_QFileSystemModel::roleNames_data() { QTest::addColumn<int>("role"); QTest::addColumn<QByteArray>("roleName"); - QTest::newRow("decoration") << int(Qt::DecorationRole) << QByteArray("decoration"); + QTest::newRow("decoration") << int(Qt::DecorationRole) << QByteArray("fileIcon"); QTest::newRow("display") << int(Qt::DisplayRole) << QByteArray("display"); QTest::newRow("fileIcon") << int(QFileSystemModel::FileIconRole) << QByteArray("fileIcon"); QTest::newRow("filePath") << int(QFileSystemModel::FilePathRole) << QByteArray("filePath"); @@ -1065,8 +1065,8 @@ void tst_QFileSystemModel::roleNames() QVERIFY(roles.contains(role)); QFETCH(QByteArray, roleName); - QList<QByteArray> values = roles.values(role); - QVERIFY(values.contains(roleName)); + QCOMPARE(roles.values(role).count(), 1); + QCOMPARE(roles.value(role), roleName); } static inline QByteArray permissionRowName(bool readOnly, int permission) |