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();
|
m_data.kdf->randomizeSeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QByteArray oldTransformedMasterKey = m_data.transformedMasterKey;
|
||||||
QByteArray transformedMasterKey;
|
QByteArray transformedMasterKey;
|
||||||
if (!key.transform(*m_data.kdf, transformedMasterKey)) {
|
if (!key.transform(*m_data.kdf, transformedMasterKey)) {
|
||||||
return false;
|
return false;
|
||||||
@ -272,7 +273,10 @@ bool Database::setKey(const CompositeKey& key, bool updateChangedTime, bool upda
|
|||||||
if (updateChangedTime) {
|
if (updateChangedTime) {
|
||||||
m_metadata->setMasterKeyChanged(QDateTime::currentDateTimeUtc());
|
m_metadata->setMasterKeyChanged(QDateTime::currentDateTimeUtc());
|
||||||
}
|
}
|
||||||
emit modifiedImmediate();
|
|
||||||
|
if (oldTransformedMasterKey != m_data.transformedMasterKey) {
|
||||||
|
emit modifiedImmediate();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -461,7 +465,9 @@ QString Database::saveToFile(QString filePath)
|
|||||||
if (saveFile.open(QIODevice::WriteOnly)) {
|
if (saveFile.open(QIODevice::WriteOnly)) {
|
||||||
|
|
||||||
// write the database to the file
|
// write the database to the file
|
||||||
|
setEmitModified(false);
|
||||||
writer.writeDatabase(&saveFile, this);
|
writer.writeDatabase(&saveFile, this);
|
||||||
|
setEmitModified(true);
|
||||||
|
|
||||||
if (writer.hasError()) {
|
if (writer.hasError()) {
|
||||||
return writer.errorString();
|
return writer.errorString();
|
||||||
|
Loading…
Reference in New Issue
Block a user