summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 85e96993..1e2ec68b 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -153,8 +153,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QDebug>
#include <QtGlobal>
-#include <QtConcurrent/QtConcurrentRun>
-
#ifndef Q_MOC_RUN
#include <boost/thread.hpp>
#include <boost/algorithm/string.hpp>
@@ -901,6 +899,8 @@ void MainWindow::cleanup()
QWebEngineProfile::defaultProfile()->clearAllVisitedLinks();
m_IntegratedBrowser.close();
+ m_SaveMetaTimer.stop();
+ m_MetaSave.waitForFinished();
}
@@ -1568,9 +1568,13 @@ void MainWindow::checkBSAList()
void MainWindow::saveModMetas()
{
- for (unsigned int i = 0; i < ModInfo::getNumMods(); ++i) {
- ModInfo::Ptr modInfo = ModInfo::getByIndex(i);
- modInfo->saveMeta();
+ if (m_MetaSave.isFinished()) {
+ m_MetaSave = QtConcurrent::run([this]() {
+ for (unsigned int i = 0; i < ModInfo::getNumMods(); ++i) {
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(i);
+ modInfo->saveMeta();
+ }
+ });
}
}