summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-08-23 22:33:59 +0200
committerPetr Mrázek <peterix@gmail.com>2015-08-23 22:33:59 +0200
commit961c1c61b8b8d0e1242edcc59a4db97ad6fb7d7b (patch)
treee3a0e0c497e7a7f2fb4c41e425458e88a9997b74
parent0d152472475aae54385f47d709c59a792689f7b4 (diff)
downloadMultiMC-961c1c61b8b8d0e1242edcc59a4db97ad6fb7d7b.tar
MultiMC-961c1c61b8b8d0e1242edcc59a4db97ad6fb7d7b.tar.gz
MultiMC-961c1c61b8b8d0e1242edcc59a4db97ad6fb7d7b.tar.lz
MultiMC-961c1c61b8b8d0e1242edcc59a4db97ad6fb7d7b.tar.xz
MultiMC-961c1c61b8b8d0e1242edcc59a4db97ad6fb7d7b.zip
GH-1206 fix deleting files during update
Backups weren't created properly which led to failure to update
-rw-r--r--application/MultiMC.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp
index 605e3763..98919d30 100644
--- a/application/MultiMC.cpp
+++ b/application/MultiMC.cpp
@@ -782,10 +782,13 @@ void MultiMC::installUpdates(const QString updateFilesDir, GoUpdate::OperationLi
// delete = move original to backup
case GoUpdate::Operation::OP_DELETE:
{
- QString trashFilePath = PathCombine(backupPath, op.file);
QString origFilePath = PathCombine(root(), op.file);
if(QFile::exists(origFilePath))
{
+ QString backupName = op.file;
+ backupName.replace('/', '_');
+ QString trashFilePath = PathCombine(backupPath, backupName);
+
if(!QFile::rename(origFilePath, trashFilePath))
{
qWarning() << "DELETE: Couldn't move:" << op.file << "to" << trashFilePath;