From 5f42470c44d83b2337eb97ce16af950b79dc4f66 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sat, 17 Dec 2011 22:10:09 +1000 Subject: [PATCH] More update file stuff --- UpdaterWindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UpdaterWindow.cpp b/UpdaterWindow.cpp index 3cc1f37d..9a0fecfa 100644 --- a/UpdaterWindow.cpp +++ b/UpdaterWindow.cpp @@ -374,12 +374,14 @@ void UpdaterWindow::replyFinished(QNetworkReply * reply) } while (!line.isNull()); } else { QString fn=files.at(i).section("/",-1); + // delete backups if (f.exists(backups+fn)) f.remove(backups+fn); + // rename (move) current file to backup if (!f.rename(apppath+fn,backups+fn)) { errors++; } - - f.setFileName(path); + //Save zip data as new file + f.setFileName(apppath+fn); f.open(QFile::WriteOnly); f.write(ba); f.close();