Notify entry/group parent on deletion.

Also make the root group pseudo static, i.e. it shouldn't be changed
after the database has been fully constructed.
This commit is contained in:
Felix Geyer 2011-07-09 21:54:01 +02:00
parent d4f02a78a7
commit 027362be76
11 changed files with 90 additions and 41 deletions

View file

@ -28,7 +28,7 @@
Database::Database()
{
m_metadata = new Metadata(this);
m_rootGroup = 0;
setRootGroup(new Group());
m_cipher = KeePass2::CIPHER_AES;
m_compressionAlgo = CompressionGZip;
@ -47,11 +47,10 @@ const Group* Database::rootGroup() const
void Database::setRootGroup(Group* group)
{
if (group != 0) {
group->setParent(this);
}
Q_ASSERT(group);
m_rootGroup = group;
m_rootGroup->setParent(this);
}
Metadata* Database::metadata()