diff options
| author | Tannin <devnull@localhost> | 2015-01-03 12:35:25 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-01-03 12:35:25 +0100 |
| commit | 9b5c238938461f8c811555647e459259b8aca2b3 (patch) | |
| tree | 504d5d876b43da5d2e0b90fe5625dad7eb1dc7c3 /src/installationmanager.cpp | |
| parent | e7b6a7cbddec32d300a1f758281c717402525053 (diff) | |
- repository info is now stored with the mod
Diffstat (limited to 'src/installationmanager.cpp')
| -rw-r--r-- | src/installationmanager.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index 26329729..880587b7 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -513,7 +513,8 @@ bool InstallationManager::ensureValidModName(GuessedValue<QString> &name) const }
bool InstallationManager::doInstall(GuessedValue<QString> &modName, int modID,
- const QString &version, const QString &newestVersion, int categoryID)
+ const QString &version, const QString &newestVersion,
+ int categoryID, const QString &repository)
{
if (!ensureValidModName(modName)) {
return false;
@@ -568,6 +569,7 @@ bool InstallationManager::doInstall(GuessedValue<QString> &modName, int modID, settingsFile.setValue("category", QString::number(categoryID));
}
settingsFile.setValue("installationFile", m_CurrentFile);
+ settingsFile.setValue("repository", repository);
if (!merge) {
// this does not clear the list we have in memory but the mod is going to have to be re-read anyway
@@ -631,6 +633,7 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> QString version = "";
QString newestVersion = "";
int categoryID = 0;
+ QString repository = "Nexus";
QString metaName = fileName.mid(0).append(".meta");
if (QFile(metaName).exists()) {
@@ -643,6 +646,7 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> newestVersion = metaFile.value("newestVersion", "").toString();
unsigned int categoryIndex = CategoryFactory::instance().resolveNexusID(metaFile.value("category", 0).toInt());
categoryID = CategoryFactory::instance().getCategoryID(categoryIndex);
+ repository = metaFile.value("repository", "").toString();
}
if (version.isEmpty()) {
@@ -707,7 +711,7 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> if (installResult == IPluginInstaller::RESULT_SUCCESS) {
mapToArchive(filesTree.data());
// the simple installer only prepares the installation, the rest works the same for all installers
- if (!doInstall(modName, modID, version, newestVersion, categoryID)) {
+ if (!doInstall(modName, modID, version, newestVersion, categoryID, repository)) {
installResult = IPluginInstaller::RESULT_FAILED;
}
}
@@ -722,6 +726,11 @@ bool InstallationManager::install(const QString &fileName, GuessedValue<QString> std::set<QString> installerExtensions = installerCustom->supportedExtensions();
if (installerExtensions.find(fileInfo.suffix()) != installerExtensions.end()) {
installResult = installerCustom->install(modName, fileName, version, modID);
+ unsigned int idx = ModInfo::getIndex(modName);
+ if (idx != UINT_MAX) {
+ ModInfo::Ptr info = ModInfo::getByIndex(idx);
+ info->setRepository(repository);
+ }
}
}
}
|
