mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-29 19:06:55 -05:00
Warn user if deleting entries that are referenced. (#1744)
On warning, references can be replaced with original values or ignored. Removal process can be also skipped for each conflicting entry. Resolves #852.
This commit is contained in:
parent
4d4c839afa
commit
c630214915
9 changed files with 205 additions and 61 deletions
|
|
@ -23,6 +23,9 @@
|
|||
#include "core/DatabaseIcons.h"
|
||||
#include "core/Global.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "core/Tools.h"
|
||||
|
||||
#include <QtConcurrent>
|
||||
|
||||
const int Group::DefaultIconNumber = 48;
|
||||
const int Group::RecycleBinIconNumber = 43;
|
||||
|
|
@ -119,7 +122,7 @@ const QUuid& Group::uuid() const
|
|||
|
||||
const QString Group::uuidToHex() const
|
||||
{
|
||||
return QString::fromLatin1(m_uuid.toRfc4122().toHex());
|
||||
return Tools::uuidToHex(m_uuid);
|
||||
}
|
||||
|
||||
QString Group::name() const
|
||||
|
|
@ -548,6 +551,12 @@ QList<Entry*> Group::entriesRecursive(bool includeHistoryItems) const
|
|||
return entryList;
|
||||
}
|
||||
|
||||
QList<Entry*> Group::referencesRecursive(const Entry* entry) const
|
||||
{
|
||||
auto entries = entriesRecursive();
|
||||
return QtConcurrent::blockingFiltered(entries, [entry](const Entry* e) { return e->hasReferencesTo(entry->uuid()); });
|
||||
}
|
||||
|
||||
Entry* Group::findEntryByUuid(const QUuid& uuid) const
|
||||
{
|
||||
if (uuid.isNull()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue