make $LAUNCHER_VER actually work

This commit is contained in:
Ryan Cao 2022-06-04 22:59:57 +08:00
parent 5930acc418
commit 4cecba8787
No known key found for this signature in database
GPG Key ID: 528A2C1B6656B97F
2 changed files with 7 additions and 7 deletions

View File

@ -1557,9 +1557,9 @@ QString Application::getCurseKey()
QString Application::getUserAgent()
{
QString keyOverride = m_settings->get("UserAgentOverride").toString();
if (!keyOverride.isEmpty()) {
return keyOverride;
QString uaOverride = m_settings->get("UserAgentOverride").toString();
if (!uaOverride.isEmpty()) {
return uaOverride.replace("$LAUNCHER_VER", BuildConfig.printableVersionString());
}
return BuildConfig.USER_AGENT;
@ -1567,9 +1567,9 @@ QString Application::getUserAgent()
QString Application::getUserAgentUncached()
{
QString keyOverride = m_settings->get("UserAgentOverride").toString();
if (!keyOverride.isEmpty()) {
return keyOverride;
QString uaOverride = m_settings->get("UserAgentOverride").toString();
if (!uaOverride.isEmpty()) {
return uaOverride.replace("$LAUNCHER_VER", BuildConfig.printableVersionString());
}
return BuildConfig.USER_AGENT_UNCACHED;

View File

@ -265,7 +265,7 @@
<item>
<widget class="QLabel" name="userAgentLabel">
<property name="text">
<string>Enter a custom User Agent here. The special string ${launcher_version} will be replaced with the version of the launcher.</string>
<string>Enter a custom User Agent here. The special string $LAUNCHER_VER will be replaced with the version of the launcher.</string>
</property>
</widget>
</item>