Add auto-save delay per database (#9100)

Add a new propery autosaveDelay in Metadata of the db.
The property is saved in customData to not affect database structure as this setting is unique to keepasxc.
The propery sets delay to wait since last modification before saving.

Co-authored-by: jNullj <jNullj@users.noreply.github.com>
This commit is contained in:
jNullj 2023-07-08 15:49:03 +03:00 committed by GitHub
parent a0874a0d6d
commit 35baeaff79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 272 additions and 6 deletions

View file

@ -233,6 +233,7 @@ public slots:
int autoHideTimeout = MessageWidget::DefaultAutoHideTimeout);
void showErrorMessage(const QString& errorMessage);
void hideMessage();
void triggerAutosaveTimer();
protected:
void closeEvent(QCloseEvent* event) override;
@ -251,6 +252,7 @@ private slots:
void onEntryChanged(Entry* entry);
void onGroupChanged();
void onDatabaseModified();
void onAutosaveDelayTimeout();
void connectDatabaseSignals();
void loadDatabase(bool accepted);
void unlockDatabase(bool accepted);
@ -309,6 +311,9 @@ private:
// Autoreload
bool m_blockAutoSave;
// Autosave delay
QPointer<QTimer> m_autosaveTimer;
// Auto-Type related
QString m_searchStringForAutoType;
};