From 78ae7072c9a0ea3795dc0610b389e8e335f4eee6 Mon Sep 17 00:00:00 2001 From: Silarn Date: Fri, 1 Feb 2019 00:36:44 -0600 Subject: Write the file category ID to the mod data when installing/updating --- src/installationmanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/installationmanager.cpp') diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index 769394e7..b11f5667 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -561,7 +561,7 @@ bool InstallationManager::ensureValidModName(GuessedValue &name) const bool InstallationManager::doInstall(GuessedValue &modName, QString gameName, int modID, const QString &version, const QString &newestVersion, - int categoryID, const QString &repository) + int categoryID, int fileCategoryID, const QString &repository) { if (!ensureValidModName(modName)) { return false; @@ -641,6 +641,7 @@ bool InstallationManager::doInstall(GuessedValue &modName, QString game if (!settingsFile.contains("category")) { settingsFile.setValue("category", QString::number(categoryID)); } + settingsFile.setValue("nexusFileStatus", fileCategoryID); settingsFile.setValue("installationFile", m_CurrentFile); settingsFile.setValue("repository", repository); settingsFile.setValue("url", m_URL); @@ -727,6 +728,7 @@ bool InstallationManager::install(const QString &fileName, QString version = ""; QString newestVersion = ""; int categoryID = 0; + int fileCategoryID = 1; QString repository = "Nexus"; QString metaName = fileName + ".meta"; @@ -745,6 +747,7 @@ bool InstallationManager::install(const QString &fileName, metaFile.value("category", 0).toInt()); categoryID = CategoryFactory::instance().getCategoryID(categoryIndex); repository = metaFile.value("repository", "").toString(); + fileCategoryID = metaFile.value("fileCategory", 1).toInt(); } if (version.isEmpty()) { @@ -822,7 +825,7 @@ bool InstallationManager::install(const QString &fileName, // the simple installer only prepares the installation, the rest // works the same for all installers if (!doInstall(modName, gameName, modID, version, newestVersion, categoryID, - repository)) { + fileCategoryID, repository)) { installResult = IPluginInstaller::RESULT_FAILED; } } -- cgit v1.3.1