From 22b8eb7c5a5d3a0d7033bbb57b2d248fc7c0fe11 Mon Sep 17 00:00:00 2001 From: Tannin Date: Wed, 11 Dec 2013 20:43:30 +0100 Subject: - downgrading a mod (using replace) will now change the version - bain installer will now accept archives with omod conversion data. --- src/installationmanager.cpp | 8 +++++--- src/installationmanager.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index 224602a8..07c015ea 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -426,7 +426,7 @@ QString InstallationManager::generateBackupName(const QString &directoryName) co } -bool InstallationManager::testOverwrite(GuessedValue &modName) const +bool InstallationManager::testOverwrite(GuessedValue &modName, bool *merge) const { QString targetDirectory = QDir::fromNativeSeparators(m_ModsDirectory + "\\" + modName); @@ -440,6 +440,7 @@ bool InstallationManager::testOverwrite(GuessedValue &modName) const return false; } } + *merge = (overwriteDialog.action() == QueryOverwriteDialog::ACT_MERGE); if (overwriteDialog.action() == QueryOverwriteDialog::ACT_RENAME) { bool ok = false; QString name = QInputDialog::getText(m_ParentWidget, tr("Mod Name"), tr("Name"), @@ -513,8 +514,9 @@ bool InstallationManager::doInstall(GuessedValue &modName, int modID, return false; } + bool merge = false; // determine target directory - if (!testOverwrite(modName)) { + if (!testOverwrite(modName, &merge)) { return false; } @@ -549,7 +551,7 @@ bool InstallationManager::doInstall(GuessedValue &modName, int modID, } if (!settingsFile.contains("version") || (!version.isEmpty() && - (VersionInfo(version) >= VersionInfo(settingsFile.value("version").toString())))) { + (!merge || (VersionInfo(version) >= VersionInfo(settingsFile.value("version").toString()))))) { settingsFile.setValue("version", version); } if (!newestVersion.isEmpty() || !settingsFile.contains("newestVersion")) { diff --git a/src/installationmanager.h b/src/installationmanager.h index 8b1f8c9a..b25ea957 100644 --- a/src/installationmanager.h +++ b/src/installationmanager.h @@ -140,7 +140,7 @@ public: * @param modName current possible names for the mod * @return true if we can proceed with the installation, false if the user canceled or in case of an unrecoverable error */ - virtual bool testOverwrite(MOBase::GuessedValue &modName) const; + virtual bool testOverwrite(MOBase::GuessedValue &modName, bool *merge = NULL) const; private: @@ -165,7 +165,7 @@ private: bool isSimpleArchiveTopLayer(const MOBase::DirectoryTree::Node *node, bool bainStyle); MOBase::DirectoryTree::Node *getSimpleArchiveBase(MOBase::DirectoryTree *dataTree); - bool testOverwrite(const QString &modsDirectory, MOBase::GuessedValue &modName); + //bool testOverwrite(const QString &modsDirectory, MOBase::GuessedValue &modName, bool *merge = NULL); bool doInstall(MOBase::GuessedValue &modName, int modID, const QString &version, const QString &newestVersion, int categoryID); -- cgit v1.3.1