[Backport release-10.x] Make Minecraft resource URL override consistent with other overrides (#4877)

This commit is contained in:
Alexandru Ionut Tripon 2026-02-17 21:01:49 +02:00 committed by GitHub
commit a9a15a20ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 21 additions and 7 deletions

View file

@ -73,7 +73,7 @@ void AssetUpdateTask::assetIndexFinished()
auto job = index.getDownloadJob();
if (job) {
QString resourceURL = APPLICATION->settings()->get("ResourceURL").toString();
QString resourceURL = resourceUrl();
QString source = tr("Mojang");
if (resourceURL != BuildConfig.DEFAULT_RESOURCE_BASE) {
source = QUrl(resourceURL).host();
@ -111,3 +111,12 @@ bool AssetUpdateTask::abort()
}
return true;
}
QString AssetUpdateTask::resourceUrl()
{
if (const QString urlOverride = APPLICATION->settings()->get("ResourceURLOverride").toString(); !urlOverride.isEmpty()) {
return urlOverride;
}
return BuildConfig.DEFAULT_RESOURCE_BASE;
}