mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-02 03:16:58 +03:00
feat: allow overriding URL for downloading legacy FML libs
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
f0a17d82d9
commit
caec4ef96c
5 changed files with 76 additions and 34 deletions
|
|
@ -862,23 +862,20 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||
}
|
||||
}
|
||||
{
|
||||
auto resetIfInvalid = [this](const Setting* setting) {
|
||||
if (const QUrl url(setting->get().toString()); !url.isValid() || (url.scheme() != "http" && url.scheme() != "https")) {
|
||||
m_settings->reset(setting->id());
|
||||
}
|
||||
};
|
||||
|
||||
// Meta URL
|
||||
m_settings->registerSetting("MetaURLOverride", "");
|
||||
|
||||
QUrl metaUrl(m_settings->get("MetaURLOverride").toString());
|
||||
|
||||
// get rid of invalid meta urls
|
||||
if (!metaUrl.isValid() || (metaUrl.scheme() != "http" && metaUrl.scheme() != "https"))
|
||||
m_settings->reset("MetaURLOverride");
|
||||
resetIfInvalid(m_settings->registerSetting("MetaURLOverride", "").get());
|
||||
|
||||
// Resource URL
|
||||
m_settings->registerSetting({ "ResourceURLOverride", "ResourceURL" }, "");
|
||||
resetIfInvalid(m_settings->registerSetting({ "ResourceURLOverride", "ResourceURL" }, "").get());
|
||||
|
||||
QUrl resourceUrl(m_settings->get("ResourceURLOverride").toString());
|
||||
|
||||
// get rid of invalid resource urls
|
||||
if (!resourceUrl.isValid() || (resourceUrl.scheme() != "http" && resourceUrl.scheme() != "https"))
|
||||
m_settings->reset("ResourceURLOverride");
|
||||
// Legacy FML libs URL
|
||||
resetIfInvalid(m_settings->registerSetting("LegacyFMLLibsURLOverride", "").get());
|
||||
}
|
||||
|
||||
m_settings->registerSetting("CloseAfterLaunch", false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue