From 961c1c61b8b8d0e1242edcc59a4db97ad6fb7d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 23 Aug 2015 22:33:59 +0200 Subject: GH-1206 fix deleting files during update Backups weren't created properly which led to failure to update --- application/MultiMC.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3