Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Geyer <blueice@fobos.de>2012-05-13 22:50:41 +0400
committerFlorian Geyer <blueice@fobos.de>2012-05-13 22:50:41 +0400
commita57e8f98643f33c9628aed8f18030d942bd255b5 (patch)
treee51459500a58b9ca6515c547769d1da80841d945 /tests/TestEntryModel.cpp
parent459cf051bf3fb3fde1ff442e031b46537599862e (diff)
Preserve order of custom icons.
Closes #25
Diffstat (limited to 'tests/TestEntryModel.cpp')
-rw-r--r--tests/TestEntryModel.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/TestEntryModel.cpp b/tests/TestEntryModel.cpp
index 63a2ada4b..fad81aec5 100644
--- a/tests/TestEntryModel.cpp
+++ b/tests/TestEntryModel.cpp
@@ -207,12 +207,21 @@ void TestEntryModel::testCustomIconModel()
QCOMPARE(model->rowCount(), 0);
QHash<Uuid, QImage> icons;
- Uuid iconUuid = Uuid::random();
+ QList<Uuid> iconsOrder;
+
+ Uuid iconUuid(QByteArray(16, '2'));
QImage icon;
icons.insert(iconUuid, icon);
+ iconsOrder << iconUuid;
+
+ Uuid iconUuid2(QByteArray(16, '1'));
+ QImage icon2;
+ icons.insert(iconUuid2, icon2);
+ iconsOrder << iconUuid2;
- model->setIcons(icons);
+ model->setIcons(icons, iconsOrder);
QCOMPARE(model->uuidFromIndex(model->index(0, 0)), iconUuid);
+ QCOMPARE(model->uuidFromIndex(model->index(1, 0)), iconUuid2);
delete modelTest;
delete model;