From e7f373496ed51d30d87eb1b75410d4f02f0412ec Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Sat, 18 Jul 2020 16:18:02 +0200 Subject: 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. --- application/pages/global/AccountListPage.cpp | 5 +++-- application/pages/modplatform/legacy_ftb/ListModel.cpp | 4 ++-- application/pages/modplatform/twitch/TwitchModel.cpp | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'application/pages') diff --git a/application/pages/global/AccountListPage.cpp b/application/pages/global/AccountListPage.cpp index 0453ae00..3c900fab 100644 --- a/application/pages/global/AccountListPage.cpp +++ b/application/pages/global/AccountListPage.cpp @@ -22,7 +22,6 @@ #include #include "net/NetJob.h" -#include "net/URLConstants.h" #include "Env.h" #include "dialogs/ProgressDialog.h" @@ -34,6 +33,8 @@ #include "MultiMC.h" +#include "BuildConfig.h" + AccountListPage::AccountListPage(QWidget *parent) : QMainWindow(parent), ui(new Ui::AccountListPage) { @@ -170,7 +171,7 @@ void AccountListPage::addAccount(const QString &errMsg) for (AccountProfile profile : account->profiles()) { auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png"); - auto action = Net::Download::makeCached(QUrl(URLConstants::SKINS_BASE + profile.id + ".png"), meta); + auto action = Net::Download::makeCached(QUrl(BuildConfig.SKINS_BASE + profile.id + ".png"), meta); job->addNetAction(action); meta->setStale(true); } diff --git a/application/pages/modplatform/legacy_ftb/ListModel.cpp b/application/pages/modplatform/legacy_ftb/ListModel.cpp index 105db25a..32596fb3 100644 --- a/application/pages/modplatform/legacy_ftb/ListModel.cpp +++ b/application/pages/modplatform/legacy_ftb/ListModel.cpp @@ -10,7 +10,7 @@ #include #include -#include "net/URLConstants.h" +#include namespace LegacyFTB { @@ -218,7 +218,7 @@ void ListModel::requestLogo(QString file) MetaEntryPtr entry = ENV.metacache()->resolveEntry("FTBPacks", QString("logos/%1").arg(file.section(".", 0, 0))); NetJob *job = new NetJob(QString("FTB Icon Download for %1").arg(file)); - job->addNetAction(Net::Download::makeCached(QUrl(QString(URLConstants::LEGACY_FTB_CDN_BASE_URL + "static/%1").arg(file)), entry)); + job->addNetAction(Net::Download::makeCached(QUrl(QString(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/%1").arg(file)), entry)); auto fullPath = entry->getFullPath(); QObject::connect(job, &NetJob::finished, this, [this, file, fullPath] diff --git a/application/pages/modplatform/twitch/TwitchModel.cpp b/application/pages/modplatform/twitch/TwitchModel.cpp index d9358941..9e3c3ad2 100644 --- a/application/pages/modplatform/twitch/TwitchModel.cpp +++ b/application/pages/modplatform/twitch/TwitchModel.cpp @@ -10,8 +10,6 @@ #include #include -#include "net/URLConstants.h" - namespace Twitch { ListModel::ListModel(QObject *parent) : QAbstractListModel(parent) -- cgit