mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-15 17:27:43 -05:00
Move recycle bin creation method to Group class.
This commit is contained in:
parent
a50d2709e7
commit
f6e1af30b3
@ -222,12 +222,7 @@ bool Database::hasKey()
|
|||||||
|
|
||||||
void Database::createRecycleBin()
|
void Database::createRecycleBin()
|
||||||
{
|
{
|
||||||
Group* recycleBin = new Group();
|
Group* recycleBin = Group::createRecycleBin();
|
||||||
recycleBin->setUuid(Uuid::random());
|
|
||||||
recycleBin->setName(tr("Recycle Bin"));
|
|
||||||
recycleBin->setIcon(43);
|
|
||||||
recycleBin->setSearchingEnabled(Group::Disable);
|
|
||||||
recycleBin->setAutoTypeEnabled(Group::Disable);
|
|
||||||
recycleBin->setParent(rootGroup());
|
recycleBin->setParent(rootGroup());
|
||||||
m_metadata->setRecycleBin(recycleBin);
|
m_metadata->setRecycleBin(recycleBin);
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "core/Tools.h"
|
#include "core/Tools.h"
|
||||||
|
|
||||||
const int Group::DefaultIconNumber = 48;
|
const int Group::DefaultIconNumber = 48;
|
||||||
|
const int Group::RecycleBinIconNumber = 43;
|
||||||
|
|
||||||
Group::Group()
|
Group::Group()
|
||||||
: m_iconNumber(DefaultIconNumber)
|
: m_iconNumber(DefaultIconNumber)
|
||||||
@ -59,6 +60,17 @@ Group::~Group()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Group* Group::createRecycleBin()
|
||||||
|
{
|
||||||
|
Group* recycleBin = new Group();
|
||||||
|
recycleBin->setUuid(Uuid::random());
|
||||||
|
recycleBin->setName(tr("Recycle Bin"));
|
||||||
|
recycleBin->setIcon(RecycleBinIconNumber);
|
||||||
|
recycleBin->setSearchingEnabled(Group::Disable);
|
||||||
|
recycleBin->setAutoTypeEnabled(Group::Disable);
|
||||||
|
return recycleBin;
|
||||||
|
}
|
||||||
|
|
||||||
template <class P, class V> bool Group::set(P& property, const V& value) {
|
template <class P, class V> bool Group::set(P& property, const V& value) {
|
||||||
if (property != value) {
|
if (property != value) {
|
||||||
property = value;
|
property = value;
|
||||||
|
@ -37,6 +37,9 @@ public:
|
|||||||
|
|
||||||
Group();
|
Group();
|
||||||
~Group();
|
~Group();
|
||||||
|
|
||||||
|
static Group* createRecycleBin();
|
||||||
|
|
||||||
Uuid uuid() const;
|
Uuid uuid() const;
|
||||||
QString name() const;
|
QString name() const;
|
||||||
QString notes() const;
|
QString notes() const;
|
||||||
@ -53,6 +56,7 @@ public:
|
|||||||
bool isExpired() const;
|
bool isExpired() const;
|
||||||
|
|
||||||
static const int DefaultIconNumber;
|
static const int DefaultIconNumber;
|
||||||
|
static const int RecycleBinIconNumber;
|
||||||
|
|
||||||
void setUuid(const Uuid& uuid);
|
void setUuid(const Uuid& uuid);
|
||||||
void setName(const QString& name);
|
void setName(const QString& name);
|
||||||
|
Loading…
Reference in New Issue
Block a user