mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Set the group of the entry in Database::recycleEntry().
Drop Metadata::addEntryToRecycleBin() and add a non-const Metadata::recycleBin() getter instead.
This commit is contained in:
parent
8735a4846c
commit
3d1fc6cd6d
@ -188,12 +188,12 @@ void Database::recycleEntry(Entry* entry)
|
||||
if (!m_metadata->recycleBin()) {
|
||||
Group* recycleBin = new Group();
|
||||
recycleBin->setUuid(Uuid::random());
|
||||
recycleBin->setName("Recycle Bin");
|
||||
recycleBin->setName(tr("Recycle Bin"));
|
||||
recycleBin->setIcon(43);
|
||||
recycleBin->setParent(rootGroup());
|
||||
m_metadata->setRecycleBin(recycleBin);
|
||||
}
|
||||
m_metadata->addEntryToRecycleBin(entry);
|
||||
entry->setGroup(metadata()->recycleBin());
|
||||
}
|
||||
else {
|
||||
delete entry;
|
||||
|
@ -167,6 +167,11 @@ bool Metadata::recycleBinEnabled() const
|
||||
return m_recycleBinEnabled;
|
||||
}
|
||||
|
||||
Group* Metadata::recycleBin()
|
||||
{
|
||||
return m_recycleBin;
|
||||
}
|
||||
|
||||
const Group* Metadata::recycleBin() const
|
||||
{
|
||||
return m_recycleBin;
|
||||
@ -372,8 +377,3 @@ void Metadata::removeCustomField(const QString& key)
|
||||
m_customFields.remove(key);
|
||||
Q_EMIT modified();
|
||||
}
|
||||
|
||||
void Metadata::addEntryToRecycleBin(Entry* entry)
|
||||
{
|
||||
entry->setGroup(m_recycleBin);
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
class Database;
|
||||
class Group;
|
||||
class Entry;
|
||||
|
||||
class Metadata : public QObject
|
||||
{
|
||||
@ -52,6 +51,7 @@ public:
|
||||
QImage customIcon(const Uuid& uuid) const;
|
||||
QHash<Uuid, QImage> customIcons() const;
|
||||
bool recycleBinEnabled() const;
|
||||
Group* recycleBin();
|
||||
const Group* recycleBin() const;
|
||||
QDateTime recycleBinChanged() const;
|
||||
const Group* entryTemplatesGroup() const;
|
||||
@ -93,8 +93,6 @@ public:
|
||||
void removeCustomField(const QString& key);
|
||||
void setUpdateDatetime(bool value);
|
||||
|
||||
void addEntryToRecycleBin(Entry* entry);
|
||||
|
||||
Q_SIGNALS:
|
||||
void nameTextChanged(Database* db);
|
||||
void modified();
|
||||
|
Loading…
Reference in New Issue
Block a user