Set uuids for entries.

This commit is contained in:
Felix Geyer 2012-05-10 21:35:26 +02:00
parent 2ecd11eb35
commit 9d8e276950
2 changed files with 5 additions and 0 deletions

View File

@ -177,6 +177,9 @@ Database* KeePass1Reader::readDatabase(QIODevice* device, const QString& passwor
delete entry;
}
else {
entry->setUuid(Uuid::random());
}
}
Q_ASSERT(m_tmpParent->children().isEmpty());

View File

@ -46,12 +46,14 @@ void TestKeePass1Reader::testBasic()
QCOMPARE(m_db->rootGroup()->children().size(), 2);
Group* group1 = m_db->rootGroup()->children().at(0);
QVERIFY(!group1->uuid().isNull());
QCOMPARE(group1->name(), QString("Internet"));
QCOMPARE(group1->children().size(), 2);
QCOMPARE(group1->entries().size(), 2);
QCOMPARE(group1->iconNumber(), 1);
Entry* entry11 = group1->entries().at(0);
QVERIFY(!entry11->uuid().isNull());
QCOMPARE(entry11->title(), QString("Test entry"));
QCOMPARE(entry11->iconNumber(), 1);
QCOMPARE(entry11->username(), QString("I"));