summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-11-21 12:13:20 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2020-11-21 12:13:20 +0100
commit0a912afe72a8fb765f240d59db17f7b50094b014 (patch)
tree3e74f482aafd134ec3f3249825089a89468f0f36 /src/mainwindow.cpp
parent32072ca19ec1ab520030a1fb411d8f2fca322374 (diff)
Add timer to the save list watcher to avoid error during refresh.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ecb4319b..04833e6a 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -430,7 +430,10 @@ MainWindow::MainWindow(Settings &settings
this, &MainWindow::refresherProgress);
connect(m_OrganizerCore.directoryRefresher(), SIGNAL(error(QString)), this, SLOT(showError(QString)));
- connect(&m_SavesWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(refreshSavesIfOpen()));
+ m_SavesWatcherTimer.setSingleShot(true);
+ m_SavesWatcherTimer.setInterval(500);
+ connect(&m_SavesWatcher, &QFileSystemWatcher::directoryChanged, [this]() { m_SavesWatcherTimer.start(); });
+ connect(&m_SavesWatcherTimer, &QTimer::timeout, this, &MainWindow::refreshSavesIfOpen);
connect(&m_OrganizerCore.settings(), SIGNAL(languageChanged(QString)), this, SLOT(languageChange(QString)));
connect(&m_OrganizerCore.settings(), SIGNAL(styleChanged(QString)), this, SIGNAL(styleChanged(QString)));