mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-31 12:24:26 -04:00
Add hasKey property to database and also make it accessible via the DatabaseWidget.
This commit is contained in:
parent
af8e21f125
commit
eb4f82a7ed
4 changed files with 17 additions and 1 deletions
|
@ -27,6 +27,7 @@
|
|||
|
||||
Database::Database()
|
||||
{
|
||||
m_hasKey = false;
|
||||
m_metadata = new Metadata(this);
|
||||
setRootGroup(new Group());
|
||||
rootGroup()->setUuid(Uuid::random());
|
||||
|
@ -164,6 +165,7 @@ void Database::setKey(const CompositeKey& key, const QByteArray& transformSeed,
|
|||
{
|
||||
m_transformSeed = transformSeed;
|
||||
m_transformedMasterKey = key.transform(transformSeed, transformRounds());
|
||||
m_hasKey = true;
|
||||
if (updateChangedTime) {
|
||||
m_metadata->setMasterKeyChanged(QDateTime::currentDateTime());
|
||||
}
|
||||
|
@ -174,3 +176,8 @@ void Database::setKey(const CompositeKey& key)
|
|||
{
|
||||
setKey(key, Random::randomArray(32));
|
||||
}
|
||||
|
||||
bool Database::hasKey()
|
||||
{
|
||||
return m_hasKey;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue