diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-05-16 16:09:34 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-05-16 18:42:14 +0200 |
commit | f2026df597c2cb6213a598bfaecdbfb700849a46 (patch) | |
tree | e4cc44206abe4b6bdd61c50cd9ff363b676c88bc /logic | |
parent | 416e08f7417abd767e250e185a5be8bd1110dae8 (diff) | |
download | MultiMC-f2026df597c2cb6213a598bfaecdbfb700849a46.tar MultiMC-f2026df597c2cb6213a598bfaecdbfb700849a46.tar.gz MultiMC-f2026df597c2cb6213a598bfaecdbfb700849a46.tar.lz MultiMC-f2026df597c2cb6213a598bfaecdbfb700849a46.tar.xz MultiMC-f2026df597c2cb6213a598bfaecdbfb700849a46.zip |
GH-952 do not remove {version,custom}.json files, rename them
Diffstat (limited to 'logic')
-rw-r--r-- | logic/minecraft/OneSixProfileStrategy.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/logic/minecraft/OneSixProfileStrategy.cpp b/logic/minecraft/OneSixProfileStrategy.cpp index 389b5f06..a84f0387 100644 --- a/logic/minecraft/OneSixProfileStrategy.cpp +++ b/logic/minecraft/OneSixProfileStrategy.cpp @@ -22,13 +22,13 @@ void OneSixProfileStrategy::upgradeDeprecatedFiles() auto mcJson = PathCombine(m_instance->instanceRoot(), "patches" , "net.minecraft.json"); QString sourceFile; - QString deleteFile; + QString renameFile; // convert old crap. if(QFile::exists(customJsonPath)) { sourceFile = customJsonPath; - deleteFile = versionJsonPath; + renameFile = versionJsonPath; } else if(QFile::exists(versionJsonPath)) { @@ -41,11 +41,11 @@ void OneSixProfileStrategy::upgradeDeprecatedFiles() qWarning() << "Couldn't create patches folder for" << m_instance->name(); return; } - if(!deleteFile.isEmpty() && QFile::exists(deleteFile)) + if(!renameFile.isEmpty() && QFile::exists(renameFile)) { - if(!QFile::remove(deleteFile)) + if(!QFile::rename(renameFile, renameFile + ".old")) { - qWarning() << "Couldn't remove" << deleteFile << "from" << m_instance->name(); + qWarning() << "Couldn't rename" << renameFile << "to" << renameFile + ".old" << "in" << m_instance->name(); return; } } @@ -68,9 +68,9 @@ void OneSixProfileStrategy::upgradeDeprecatedFiles() qWarning() << "Couldn't save main patch in" << m_instance->name(); return; } - if(!QFile::remove(sourceFile)) + if(!QFile::rename(sourceFile, sourceFile + ".old")) { - qWarning() << "Couldn't remove" << sourceFile << "from" << m_instance->name(); + qWarning() << "Couldn't rename" << sourceFile << "to" << sourceFile + ".old" << "in" << m_instance->name(); return; } } |