mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-22 19:51:16 -05:00
Move deleted entries to recycle bin if enabled.
This commit is contained in:
parent
5661f29f7d
commit
8735a4846c
5 changed files with 45 additions and 1 deletions
|
|
@ -181,3 +181,21 @@ bool Database::hasKey()
|
|||
{
|
||||
return m_hasKey;
|
||||
}
|
||||
|
||||
void Database::recycleEntry(Entry* entry)
|
||||
{
|
||||
if (m_metadata->recycleBinEnabled()) {
|
||||
if (!m_metadata->recycleBin()) {
|
||||
Group* recycleBin = new Group();
|
||||
recycleBin->setUuid(Uuid::random());
|
||||
recycleBin->setName("Recycle Bin");
|
||||
recycleBin->setIcon(43);
|
||||
recycleBin->setParent(rootGroup());
|
||||
m_metadata->setRecycleBin(recycleBin);
|
||||
}
|
||||
m_metadata->addEntryToRecycleBin(entry);
|
||||
}
|
||||
else {
|
||||
delete entry;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue