From 9c8e43853dfeb6ac80faffe0960222ff0f087fd3 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 12 Feb 2014 21:00:49 +0100 Subject: - a few hooks will now somewhat handle file names starting with \\?\ - mod meta information is now (also) saved by a timer to reduce the likelyhood of a data loss in case of a crash - mod meta files are now written to a temporary file and then renamed to real name to reduce chance of breaking the file - updated minimum compatible nmm version to 0.47.0 - bugfix: defaults for newestVersion, version and installationFile when creating an empty mod were integers instead of strings - bugfix: "Plugins" and "Archives" weren't translatable --- src/mainwindow.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d83d4d06..12db5e2b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -295,6 +295,10 @@ MainWindow::MainWindow(const QString &exeName, QSettings &initSettings, QWidget m_CheckBSATimer.setSingleShot(true); connect(&m_CheckBSATimer, SIGNAL(timeout()), this, SLOT(checkBSAList())); + m_SaveMetaTimer.setSingleShot(false); + connect(&m_SaveMetaTimer, SIGNAL(timeout()), this, SLOT(saveModMetas())); + m_SaveMetaTimer.start(5000); + m_DirectoryRefresher.moveToThread(&m_RefresherThread); m_RefresherThread.start(); @@ -1208,10 +1212,10 @@ IModInterface *MainWindow::createMod(GuessedValue &name) QSettings settingsFile(targetDirectory.mid(0).append("/meta.ini"), QSettings::IniFormat); settingsFile.setValue("modid", 0); - settingsFile.setValue("version", 0); - settingsFile.setValue("newestVersion", 0); + settingsFile.setValue("version", ""); + settingsFile.setValue("newestVersion", ""); settingsFile.setValue("category", 0); - settingsFile.setValue("installationFile", 0); + settingsFile.setValue("installationFile", ""); return ModInfo::createFrom(QDir(targetDirectory), &m_DirectoryStructure).data(); // } } @@ -1956,6 +1960,15 @@ void MainWindow::checkBSAList() } +void MainWindow::saveModMetas() +{ + for (unsigned int i = 0; i < ModInfo::getNumMods(); ++i) { + ModInfo::Ptr modInfo = ModInfo::getByIndex(i); + modInfo->saveMeta(); + } + } + + void MainWindow::fixCategories() { for (unsigned int i = 0; i < ModInfo::getNumMods(); ++i) { -- cgit v1.3.1