summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/installationmanager.cpp8
-rw-r--r--src/installationmanager.h4
2 files changed, 7 insertions, 5 deletions
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<QString> &modName) const
+bool InstallationManager::testOverwrite(GuessedValue<QString> &modName, bool *merge) const
{
QString targetDirectory = QDir::fromNativeSeparators(m_ModsDirectory + "\\" + modName);
@@ -440,6 +440,7 @@ bool InstallationManager::testOverwrite(GuessedValue<QString> &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<QString> &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<QString> &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<QString> &modName) const;
+ virtual bool testOverwrite(MOBase::GuessedValue<QString> &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<QString> &modName);
+ //bool testOverwrite(const QString &modsDirectory, MOBase::GuessedValue<QString> &modName, bool *merge = NULL);
bool doInstall(MOBase::GuessedValue<QString> &modName,
int modID, const QString &version, const QString &newestVersion, int categoryID);