mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Correct regression in database modification signal
This commit is contained in:
parent
542ee42313
commit
738f870e70
@ -261,6 +261,7 @@ bool Database::setKey(const CompositeKey& key, bool updateChangedTime, bool upda
|
||||
m_data.kdf->randomizeSeed();
|
||||
}
|
||||
|
||||
QByteArray oldTransformedMasterKey = m_data.transformedMasterKey;
|
||||
QByteArray transformedMasterKey;
|
||||
if (!key.transform(*m_data.kdf, transformedMasterKey)) {
|
||||
return false;
|
||||
@ -272,7 +273,10 @@ bool Database::setKey(const CompositeKey& key, bool updateChangedTime, bool upda
|
||||
if (updateChangedTime) {
|
||||
m_metadata->setMasterKeyChanged(QDateTime::currentDateTimeUtc());
|
||||
}
|
||||
emit modifiedImmediate();
|
||||
|
||||
if (oldTransformedMasterKey != m_data.transformedMasterKey) {
|
||||
emit modifiedImmediate();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -461,7 +465,9 @@ QString Database::saveToFile(QString filePath)
|
||||
if (saveFile.open(QIODevice::WriteOnly)) {
|
||||
|
||||
// write the database to the file
|
||||
setEmitModified(false);
|
||||
writer.writeDatabase(&saveFile, this);
|
||||
setEmitModified(true);
|
||||
|
||||
if (writer.hasError()) {
|
||||
return writer.errorString();
|
||||
|
Loading…
Reference in New Issue
Block a user