summaryrefslogtreecommitdiffstats
path: root/logic/OneSixUpdate.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-01-31 16:59:03 +0100
committerPetr Mrázek <peterix@gmail.com>2015-04-02 11:30:24 +0200
commit6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f (patch)
tree28aaf76918d1ff0ffe2a437573bb1ab7a012c4ec /logic/OneSixUpdate.cpp
parente508728246043fcaf8bee565e73b15e15eb2e531 (diff)
downloadMultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.tar
MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.tar.gz
MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.tar.lz
MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.tar.xz
MultiMC-6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f.zip
NOISSUE Split MultiMC app object into MultiMC and Env
Diffstat (limited to 'logic/OneSixUpdate.cpp')
-rw-r--r--logic/OneSixUpdate.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/logic/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp
index 692e4ce3..26a55cc9 100644
--- a/logic/OneSixUpdate.cpp
+++ b/logic/OneSixUpdate.cpp
@@ -14,6 +14,7 @@
*/
#include "MultiMC.h"
+#include "logic/Env.h"
#include "OneSixUpdate.h"
#include <QtNetwork>
@@ -94,7 +95,7 @@ void OneSixUpdate::assetIndexStart()
QString localPath = assetName + ".json";
auto job = new NetJob(tr("Asset index for %1").arg(inst->name()));
- auto metacache = MMC->metacache();
+ auto metacache = ENV.metacache();
auto entry = metacache->resolveEntry("asset_indexes", localPath);
job->addNetAction(CacheDownload::make(indexUrl, entry));
jarlibDownloadJob.reset(job);
@@ -118,7 +119,7 @@ void OneSixUpdate::assetIndexFinished()
QString asset_fname = "assets/indexes/" + assetName + ".json";
if (!AssetsUtils::loadAssetsIndexJson(asset_fname, &index))
{
- auto metacache = MMC->metacache();
+ auto metacache = ENV.metacache();
auto entry = metacache->resolveEntry("asset_indexes", assetName + ".json");
metacache->evictEntry(entry);
emitFailed(tr("Failed to read the assets index!"));
@@ -200,7 +201,7 @@ void OneSixUpdate::jarlibStart()
auto job = new NetJob(tr("Libraries for instance %1").arg(inst->name()));
- auto metacache = MMC->metacache();
+ auto metacache = ENV.metacache();
auto entry = metacache->resolveEntry("versions", localPath);
job->addNetAction(CacheDownload::make(QUrl(urlstr), entry));
jarHashOnEntry = entry->md5sum;
@@ -211,7 +212,7 @@ void OneSixUpdate::jarlibStart()
auto libs = version->getActiveNativeLibs();
libs.append(version->getActiveNormalLibs());
- auto metacache = MMC->metacache();
+ auto metacache = ENV.metacache();
QList<ForgeXzDownloadPtr> ForgeLibs;
QList<std::shared_ptr<OneSixLibrary>> brokenLocalLibs;
@@ -317,7 +318,7 @@ void OneSixUpdate::jarlibFinished()
{
auto sourceJarPath = m_inst->versionsPath().absoluteFilePath(version->id + "/" + version->id + ".jar");
QString localPath = version_id + "/" + version_id + ".jar";
- auto metacache = MMC->metacache();
+ auto metacache = ENV.metacache();
auto entry = metacache->resolveEntry("versions", localPath);
QString fullJarPath = entry->getFullPath();
if(!JarUtils::createModdedJar(sourceJarPath, finalJarPath, jarMods))
@@ -390,7 +391,7 @@ void OneSixUpdate::fmllibsStart()
// download missing libs to our place
setStatus(tr("Dowloading FML libraries..."));
auto dljob = new NetJob("FML libraries");
- auto metacache = MMC->metacache();
+ auto metacache = ENV.metacache();
for (auto &lib : fmlLibsToProcess)
{
auto entry = metacache->resolveEntry("fmllibs", lib.filename);
@@ -413,7 +414,7 @@ void OneSixUpdate::fmllibsFinished()
{
setStatus(tr("Copying FML libraries into the instance..."));
OneSixInstance *inst = (OneSixInstance *)m_inst;
- auto metacache = MMC->metacache();
+ auto metacache = ENV.metacache();
int index = 0;
for (auto &lib : fmlLibsToProcess)
{