diff options
| author | Tannin <devnull@localhost> | 2014-02-12 21:00:49 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-02-12 21:00:49 +0100 |
| commit | 9c8e43853dfeb6ac80faffe0960222ff0f087fd3 (patch) | |
| tree | a08077f950ac1c77b33900f4724c11be6a43e877 /src/mainwindow.cpp | |
| parent | 7aadb476376db1d23ad333abb439639552bb6e19 (diff) | |
- 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
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
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<QString> &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) { |
