From e39de4dd2ab6c19c6b9557f99117f7ffc9ed1cc1 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Wed, 18 Nov 2020 19:22:05 +0100 Subject: Update following addition of IPluginGame::listSaves(). --- src/mainwindow.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mainwindow.h') diff --git a/src/mainwindow.h b/src/mainwindow.h index e2805b25..da916d2a 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -334,6 +334,7 @@ private: QTime m_StartTime; //SaveGameInfoWidget *m_CurrentSaveView; + std::vector> m_SaveGames; MOBase::ISaveGameInfoWidget *m_CurrentSaveView; OrganizerCore &m_OrganizerCore; -- cgit v1.3.1 From 0a912afe72a8fb765f240d59db17f7b50094b014 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Sat, 21 Nov 2020 12:13:20 +0100 Subject: Add timer to the save list watcher to avoid error during refresh. --- src/mainwindow.cpp | 5 ++++- src/mainwindow.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.h') 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))); diff --git a/src/mainwindow.h b/src/mainwindow.h index da916d2a..da7bb6ee 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -345,6 +345,7 @@ private: std::unique_ptr m_IntegratedBrowser; + QTimer m_SavesWatcherTimer; QFileSystemWatcher m_SavesWatcher; QByteArray m_ArchiveListHash; -- cgit v1.3.1