summaryrefslogtreecommitdiffstats
path: root/logic/updater/DownloadUpdateTask.cpp
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-12-13 14:58:35 +0000
committerSky <git@bunnies.cc>2013-12-13 14:58:35 +0000
commitb69351d50d07bab595945d064e4d29b123c19105 (patch)
tree5cf6be9ef49ad10a211a0544e5481f36e49a306a /logic/updater/DownloadUpdateTask.cpp
parent979946b7bb2cec808198f9194169ea08cce8bb00 (diff)
parent0af6f96c3de54c940799826ff6f3c89bb46f1540 (diff)
downloadMultiMC-b69351d50d07bab595945d064e4d29b123c19105.tar
MultiMC-b69351d50d07bab595945d064e4d29b123c19105.tar.gz
MultiMC-b69351d50d07bab595945d064e4d29b123c19105.tar.lz
MultiMC-b69351d50d07bab595945d064e4d29b123c19105.tar.xz
MultiMC-b69351d50d07bab595945d064e4d29b123c19105.zip
Merge branch 'develop' of github.com:Drayshak/MultiMC5 into develop
Diffstat (limited to 'logic/updater/DownloadUpdateTask.cpp')
-rw-r--r--logic/updater/DownloadUpdateTask.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/logic/updater/DownloadUpdateTask.cpp b/logic/updater/DownloadUpdateTask.cpp
index 3fe24482..d9aab826 100644
--- a/logic/updater/DownloadUpdateTask.cpp
+++ b/logic/updater/DownloadUpdateTask.cpp
@@ -239,13 +239,19 @@ void DownloadUpdateTask::processFileLists()
// delete anything in the current one version's list that isn't in the new version's list.
for (VersionFileEntry entry : m_cVersionFileList)
{
+ bool keep = false;
for (VersionFileEntry newEntry : m_nVersionFileList)
- {
+ {
if (newEntry.path == entry.path)
- continue;
+ {
+ QLOG_DEBUG() << "Not deleting" << entry.path << "because it is still present in the new version.";
+ keep = true;
+ break;
+ }
}
- // If the loop reaches the end, we didn't find a match. Delete the file.
- m_operationList.append(UpdateOperation::DeleteOp(entry.path));
+ // If the loop reaches the end and we didn't find a match, delete the file.
+ if(!keep)
+ m_operationList.append(UpdateOperation::DeleteOp(entry.path));
}
// Create a network job for downloading files.