Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/FileWatcher.cpp')
-rw-r--r--src/core/FileWatcher.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/FileWatcher.cpp b/src/core/FileWatcher.cpp
index 2d37734aa..430e60274 100644
--- a/src/core/FileWatcher.cpp
+++ b/src/core/FileWatcher.cpp
@@ -118,13 +118,16 @@ void FileWatcher::checkFileChanged()
// Prevent reentrance
m_ignoreFileChange = true;
- auto checksum = AsyncTask::runAndWaitForFuture([this]() -> QByteArray { return calculateChecksum(); });
- if (checksum != m_fileChecksum) {
- m_fileChecksum = checksum;
- m_fileChangeDelayTimer.start(0);
- }
-
- m_ignoreFileChange = false;
+ AsyncTask::runThenCallback([=] { return calculateChecksum(); },
+ this,
+ [=](QByteArray checksum) {
+ if (checksum != m_fileChecksum) {
+ m_fileChecksum = checksum;
+ m_fileChangeDelayTimer.start(0);
+ }
+
+ m_ignoreFileChange = false;
+ });
}
QByteArray FileWatcher::calculateChecksum()