diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-01-31 16:59:03 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-04-02 11:30:24 +0200 |
commit | 6f3aa65bd69f5155fa1ee56dee840e2e7e1d3c6f (patch) | |
tree | 28aaf76918d1ff0ffe2a437573bb1ab7a012c4ec /logic/forge | |
parent | e508728246043fcaf8bee565e73b15e15eb2e531 (diff) | |
download | MultiMC-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/forge')
-rw-r--r-- | logic/forge/ForgeInstaller.cpp | 11 | ||||
-rw-r--r-- | logic/forge/ForgeMirrors.cpp | 4 | ||||
-rw-r--r-- | logic/forge/ForgeVersionList.cpp | 6 | ||||
-rw-r--r-- | logic/forge/ForgeXzDownload.cpp | 6 |
4 files changed, 14 insertions, 13 deletions
diff --git a/logic/forge/ForgeInstaller.cpp b/logic/forge/ForgeInstaller.cpp index 01671306..19cecaeb 100644 --- a/logic/forge/ForgeInstaller.cpp +++ b/logic/forge/ForgeInstaller.cpp @@ -21,6 +21,7 @@ #include "logic/OneSixInstance.h" #include "logic/forge/ForgeVersionList.h" #include "logic/minecraft/VersionFilterData.h" +#include "logic/Env.h" #include <quazip.h> #include <quazipfile.h> @@ -28,7 +29,7 @@ #include <QStringList> #include <QRegularExpression> #include <QRegularExpressionMatch> -#include "MultiMC.h" + #include <QJsonDocument> #include <QJsonArray> #include <QSaveFile> @@ -86,7 +87,7 @@ void ForgeInstaller::prepare(const QString &filename, const QString &universalUr // where do we put the library? decode the mojang path OneSixLibrary lib(libraryName); - auto cacheentry = MMC->metacache()->resolveEntry("libraries", lib.storagePath()); + auto cacheentry = ENV.metacache()->resolveEntry("libraries", lib.storagePath()); finalPath = "libraries/" + lib.storagePath(); if (!ensureFilePathExists(finalPath)) return; @@ -110,7 +111,7 @@ void ForgeInstaller::prepare(const QString &filename, const QString &universalUr cacheentry->stale = false; cacheentry->md5sum = md5sum.result().toHex().constData(); - MMC->metacache()->updateEntry(cacheentry); + ENV.metacache()->updateEntry(cacheentry); } file.close(); @@ -275,7 +276,7 @@ bool ForgeInstaller::addLegacy(OneSixInstance *to) { return false; } - auto entry = MMC->metacache()->resolveEntry("minecraftforge", m_forge_version->filename()); + auto entry = ENV.metacache()->resolveEntry("minecraftforge", m_forge_version->filename()); finalPath = PathCombine(to->jarModsDir(), m_forge_version->filename()); if (!ensureFilePathExists(finalPath)) { @@ -346,7 +347,7 @@ protected: } void prepare(ForgeVersionPtr forgeVersion) { - auto entry = MMC->metacache()->resolveEntry("minecraftforge", forgeVersion->filename()); + auto entry = ENV.metacache()->resolveEntry("minecraftforge", forgeVersion->filename()); auto installFunction = [this, entry, forgeVersion]() { if (!install(entry, forgeVersion)) diff --git a/logic/forge/ForgeMirrors.cpp b/logic/forge/ForgeMirrors.cpp index b224306f..bb50d0b7 100644 --- a/logic/forge/ForgeMirrors.cpp +++ b/logic/forge/ForgeMirrors.cpp @@ -1,4 +1,4 @@ -#include "MultiMC.h" +#include "logic/Env.h" #include "ForgeMirrors.h" #include "logger/QsLog.h" #include <algorithm> @@ -18,7 +18,7 @@ void ForgeMirrors::start() QLOG_INFO() << "Downloading " << m_url.toString(); QNetworkRequest request(m_url); request.setHeader(QNetworkRequest::UserAgentHeader, "MultiMC/5.0 (Uncached)"); - auto worker = MMC->qnam(); + auto worker = ENV.qnam(); QNetworkReply *rep = worker->get(request); m_reply = std::shared_ptr<QNetworkReply>(rep); diff --git a/logic/forge/ForgeVersionList.cpp b/logic/forge/ForgeVersionList.cpp index 3e736b78..d7bb8af2 100644 --- a/logic/forge/ForgeVersionList.cpp +++ b/logic/forge/ForgeVersionList.cpp @@ -17,7 +17,7 @@ #include "logic/forge/ForgeVersion.h" #include "logic/net/NetJob.h" #include "logic/net/URLConstants.h" -#include "MultiMC.h" +#include "logic/Env.h" #include <QtNetwork> #include <QtXml> @@ -162,8 +162,8 @@ void ForgeListLoadTask::executeTask() setStatus(tr("Fetching Forge version lists...")); auto job = new NetJob("Version index"); // we do not care if the version is stale or not. - auto forgeListEntry = MMC->metacache()->resolveEntry("minecraftforge", "list.json"); - auto gradleForgeListEntry = MMC->metacache()->resolveEntry("minecraftforge", "json"); + auto forgeListEntry = ENV.metacache()->resolveEntry("minecraftforge", "list.json"); + auto gradleForgeListEntry = ENV.metacache()->resolveEntry("minecraftforge", "json"); // verify by poking the server. forgeListEntry->stale = true; diff --git a/logic/forge/ForgeXzDownload.cpp b/logic/forge/ForgeXzDownload.cpp index 781fa385..c2e5f76e 100644 --- a/logic/forge/ForgeXzDownload.cpp +++ b/logic/forge/ForgeXzDownload.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "MultiMC.h" +#include "logic/Env.h" #include "ForgeXzDownload.h" #include <pathutils.h> @@ -67,7 +67,7 @@ void ForgeXzDownload::start() request.setRawHeader(QString("If-None-Match").toLatin1(), m_entry->etag.toLatin1()); request.setHeader(QNetworkRequest::UserAgentHeader, "MultiMC/5.0 (Cached)"); - auto worker = MMC->qnam(); + auto worker = ENV.qnam(); QNetworkReply *rep = worker->get(request); m_reply = std::shared_ptr<QNetworkReply>(rep); @@ -382,7 +382,7 @@ void ForgeXzDownload::decompressAndInstall() m_entry->local_changed_timestamp = output_file_info.lastModified().toUTC().toMSecsSinceEpoch(); m_entry->stale = false; - MMC->metacache()->updateEntry(m_entry); + ENV.metacache()->updateEntry(m_entry); m_reply.reset(); emit succeeded(m_index_within_job); |