mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-26 07:49:50 -05:00
Fix infinite save bug when saving fails
* Introduced in #6438, modified signal is not blocked at the Database level when emitting is blocked. This causes infinite saving to occur when Always Save After Every Change is enabled.
This commit is contained in:
parent
bd744d1e32
commit
484bc5dd01
@ -875,7 +875,7 @@ bool Database::hasNonDataChanges() const
|
||||
void Database::markAsModified()
|
||||
{
|
||||
m_modified = true;
|
||||
if (!m_modifiedTimer.isActive()) {
|
||||
if (modifiedSignalEnabled() && !m_modifiedTimer.isActive()) {
|
||||
// Small time delay prevents numerous consecutive saves due to repeated signals
|
||||
startModifiedTimer();
|
||||
}
|
||||
@ -942,11 +942,13 @@ bool Database::changeKdf(const QSharedPointer<Kdf>& kdf)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Prevent warning about QTimer not allowed to be started/stopped from other thread
|
||||
void Database::startModifiedTimer()
|
||||
{
|
||||
QMetaObject::invokeMethod(&m_modifiedTimer, "start", Q_ARG(int, 150));
|
||||
}
|
||||
|
||||
// Prevent warning about QTimer not allowed to be started/stopped from other thread
|
||||
void Database::stopModifiedTimer()
|
||||
{
|
||||
QMetaObject::invokeMethod(&m_modifiedTimer, "stop");
|
||||
|
Loading…
Reference in New Issue
Block a user