aboutsummaryrefslogtreecommitdiff
path: root/api/logic/modplatform
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2020-07-18 16:18:02 +0200
committerPetr Mrázek <peterix@gmail.com>2020-07-18 16:22:05 +0200
commite7f373496ed51d30d87eb1b75410d4f02f0412ec (patch)
treedb040fd29b1a95968324ef0b52fbc48d228d9f25 /api/logic/modplatform
parent3158082b16009907e1abed0308498d10788f0f42 (diff)
downloadPrismLauncher-e7f373496ed51d30d87eb1b75410d4f02f0412ec.tar.gz
PrismLauncher-e7f373496ed51d30d87eb1b75410d4f02f0412ec.tar.bz2
PrismLauncher-e7f373496ed51d30d87eb1b75410d4f02f0412ec.zip
GH-3234 Add support for custom meta URLs at build time
This is not particularly interesting for non-developers. Also includes some internal restructuring of URL constants in general.
Diffstat (limited to 'api/logic/modplatform')
-rw-r--r--api/logic/modplatform/legacy_ftb/PackFetchTask.cpp8
-rw-r--r--api/logic/modplatform/legacy_ftb/PackInstallTask.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/api/logic/modplatform/legacy_ftb/PackFetchTask.cpp b/api/logic/modplatform/legacy_ftb/PackFetchTask.cpp
index 43c1e6f8..c2ef6436 100644
--- a/api/logic/modplatform/legacy_ftb/PackFetchTask.cpp
+++ b/api/logic/modplatform/legacy_ftb/PackFetchTask.cpp
@@ -2,7 +2,7 @@
#include "PrivatePackManager.h"
#include <QDomDocument>
-#include "net/URLConstants.h"
+#include <BuildConfig.h>
namespace LegacyFTB {
@@ -13,11 +13,11 @@ void PackFetchTask::fetch()
NetJob *netJob = new NetJob("LegacyFTB::ModpackFetch");
- QUrl publicPacksUrl = QUrl(URLConstants::LEGACY_FTB_CDN_BASE_URL + "static/modpacks.xml");
+ QUrl publicPacksUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/modpacks.xml");
qDebug() << "Downloading public version info from" << publicPacksUrl.toString();
netJob->addNetAction(Net::Download::makeByteArray(publicPacksUrl, &publicModpacksXmlFileData));
- QUrl thirdPartyUrl = QUrl(URLConstants::LEGACY_FTB_CDN_BASE_URL + "static/thirdparty.xml");
+ QUrl thirdPartyUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/thirdparty.xml");
qDebug() << "Downloading thirdparty version info from" << thirdPartyUrl.toString();
netJob->addNetAction(Net::Download::makeByteArray(thirdPartyUrl, &thirdPartyModpacksXmlFileData));
@@ -30,7 +30,7 @@ void PackFetchTask::fetch()
void PackFetchTask::fetchPrivate(const QStringList & toFetch)
{
- QString privatePackBaseUrl = URLConstants::LEGACY_FTB_CDN_BASE_URL + "static/%1.xml";
+ QString privatePackBaseUrl = BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/%1.xml";
for (auto &packCode: toFetch)
{
diff --git a/api/logic/modplatform/legacy_ftb/PackInstallTask.cpp b/api/logic/modplatform/legacy_ftb/PackInstallTask.cpp
index a3f35154..9bf6c76a 100644
--- a/api/logic/modplatform/legacy_ftb/PackInstallTask.cpp
+++ b/api/logic/modplatform/legacy_ftb/PackInstallTask.cpp
@@ -9,7 +9,7 @@
#include "minecraft/MinecraftInstance.h"
#include "minecraft/PackProfile.h"
#include "minecraft/GradleSpecifier.h"
-#include "net/URLConstants.h"
+#include "BuildConfig.h"
#include <QtConcurrent>
@@ -38,11 +38,11 @@ void PackInstallTask::downloadPack()
QString url;
if(m_pack.type == PackType::Private)
{
- url = QString(URLConstants::LEGACY_FTB_CDN_BASE_URL + "privatepacks/%1").arg(packoffset);
+ url = QString(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "privatepacks/%1").arg(packoffset);
}
else
{
- url = QString(URLConstants::LEGACY_FTB_CDN_BASE_URL + "modpacks/%1").arg(packoffset);
+ url = QString(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "modpacks/%1").arg(packoffset);
}
job->addNetAction(Net::Download::makeCached(url, entry));
archivePath = entry->getFullPath();
@@ -210,4 +210,4 @@ bool PackInstallTask::abort()
return false;
}
-} \ No newline at end of file
+}