summaryrefslogtreecommitdiffstats
path: root/logic/minecraft/OneSixProfileStrategy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/minecraft/OneSixProfileStrategy.cpp')
-rw-r--r--logic/minecraft/OneSixProfileStrategy.cpp14
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;
}
}