summaryrefslogtreecommitdiffstats
path: root/logic/net/ForgeXzDownload.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-19 00:47:59 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-19 00:47:59 +0100
commit57a9dadb08a2a7ebfeba3d5f5234145b3db6c794 (patch)
tree6750dd87600286ee34a8cc7d814a08a38c91fb6f /logic/net/ForgeXzDownload.cpp
parent294c2d122f221fba2de0285d2a05ec944dbabbba (diff)
downloadMultiMC-57a9dadb08a2a7ebfeba3d5f5234145b3db6c794.tar
MultiMC-57a9dadb08a2a7ebfeba3d5f5234145b3db6c794.tar.gz
MultiMC-57a9dadb08a2a7ebfeba3d5f5234145b3db6c794.tar.lz
MultiMC-57a9dadb08a2a7ebfeba3d5f5234145b3db6c794.tar.xz
MultiMC-57a9dadb08a2a7ebfeba3d5f5234145b3db6c794.zip
Forge XZ downloads now use temp files local to MultiMC, files are removed.
Diffstat (limited to 'logic/net/ForgeXzDownload.cpp')
-rw-r--r--logic/net/ForgeXzDownload.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/logic/net/ForgeXzDownload.cpp b/logic/net/ForgeXzDownload.cpp
index 77161ab9..f119878a 100644
--- a/logic/net/ForgeXzDownload.cpp
+++ b/logic/net/ForgeXzDownload.cpp
@@ -26,6 +26,7 @@ ForgeXzDownload::ForgeXzDownload(QString relative_path, MetaEntryPtr entry) : Ne
{
m_entry = entry;
m_target_path = entry->getFullPath();
+ m_pack200_xz_file.setFileTemplate("./dl_temp.XXXXXX");
m_status = Job_NotStarted;
m_url_path = relative_path;
}
@@ -192,7 +193,7 @@ void ForgeXzDownload::decompressAndInstall()
// rewind the downloaded temp file
m_pack200_xz_file.seek(0);
// de-xz'd file
- QTemporaryFile pack200_file;
+ QTemporaryFile pack200_file("./dl_temp.XXXXXX");
pack200_file.open();
bool xz_success = false;
@@ -304,6 +305,7 @@ void ForgeXzDownload::decompressAndInstall()
}
}
}
+ m_pack200_xz_file.remove();
// revert pack200
pack200_file.close();
@@ -322,6 +324,7 @@ void ForgeXzDownload::decompressAndInstall()
failAndTryNextMirror();
return;
}
+ pack200_file.remove();
QFile jar_file(m_target_path);