Copy custom icons when moved to another database.

Closes #9
This commit is contained in:
Felix Geyer 2012-04-27 11:22:02 +02:00
parent c36481edae
commit de4b90cdf1
6 changed files with 62 additions and 0 deletions

View file

@ -404,6 +404,13 @@ void Entry::setGroup(Group* group)
m_group->removeEntry(this);
if (m_group->database() && m_group->database() != group->database()) {
m_group->database()->addDeletedObject(m_uuid);
// copy custom icon to the new database
if (!iconUuid().isNull() && group->database()
&& m_group->database()->metadata()->containsCustomIcon(iconUuid())
&& !group->database()->metadata()->containsCustomIcon(iconUuid())) {
group->database()->metadata()->addCustomIcon(iconUuid(), icon());
}
}
}