Add convenience function Database::addDeletedObject(const Uuid&).
Drop Group::addDeletedObject() and make Entry call the Database function instead.
This commit is contained in:
@@ -45,10 +45,9 @@ Entry::~Entry()
|
||||
if (m_group) {
|
||||
m_group->removeEntry(this);
|
||||
|
||||
DeletedObject delEntry;
|
||||
delEntry.deletionTime = QDateTime::currentDateTimeUtc();
|
||||
delEntry.uuid = m_uuid;
|
||||
m_group->addDeletedObject(delEntry);
|
||||
if (m_group->database()) {
|
||||
m_group->database()->addDeletedObject(m_uuid);
|
||||
}
|
||||
}
|
||||
|
||||
qDeleteAll(m_history);
|
||||
@@ -362,10 +361,7 @@ void Entry::setGroup(Group* group)
|
||||
if (m_group) {
|
||||
m_group->removeEntry(this);
|
||||
if (m_group->database() != group->database()) {
|
||||
DeletedObject delEntry;
|
||||
delEntry.deletionTime = QDateTime::currentDateTimeUtc();
|
||||
delEntry.uuid = m_uuid;
|
||||
m_group->addDeletedObject(delEntry);
|
||||
m_group->database()->addDeletedObject(m_uuid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user