aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-05-29 21:29:07 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-07-08 16:25:03 +0200
commit8a1a583afef0a719a3b793ce32bb93cc2d6180bb (patch)
tree52c72cbd17a60b6c2ec1fa57676613eec43a6f78
parentf1902a44716201d9d6431cab762663cd749b58eb (diff)
downloadPrismLauncher-8a1a583afef0a719a3b793ce32bb93cc2d6180bb.tar.gz
PrismLauncher-8a1a583afef0a719a3b793ce32bb93cc2d6180bb.tar.bz2
PrismLauncher-8a1a583afef0a719a3b793ce32bb93cc2d6180bb.zip
refactor: rename references to CurseForge to Flame
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
-rw-r--r--CMakeLists.txt2
-rw-r--r--buildconfig/BuildConfig.cpp.in2
-rw-r--r--buildconfig/BuildConfig.h2
-rw-r--r--launcher/Application.cpp21
-rw-r--r--launcher/Application.h2
-rw-r--r--launcher/net/Download.cpp2
-rw-r--r--launcher/net/Upload.cpp2
-rw-r--r--launcher/ui/pages/global/APIPage.cpp8
-rw-r--r--launcher/ui/pages/global/APIPage.ui6
9 files changed, 29 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 958e6ef6..1382f571 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -131,7 +131,7 @@ set(Launcher_MSA_CLIENT_ID "549033b2-1532-4d4e-ae77-1bbaa46f9d74" CACHE STRING "
# By using this key in your builds you accept the terms and conditions laid down in
# https://support.curseforge.com/en/support/solutions/articles/9000207405-curse-forge-3rd-party-api-terms-and-conditions
# NOTE: CurseForge requires you to change this if you make any kind of derivative work.
-set(Launcher_CURSEFORGE_API_KEY "$2a$10$1Oqr2MX3O4n/ilhFGc597u8tfI3L2Hyr9/rtWDAMRjghSQV2QUuxq" CACHE STRING "CurseForge API Key")
+set(Launcher_CURSEFORGE_API_KEY "$2a$10$1Oqr2MX3O4n/ilhFGc597u8tfI3L2Hyr9/rtWDAMRjghSQV2QUuxq" CACHE STRING "API key for the CurseForge platform")
#### Check the current Git commit and branch
diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in
index 70f8f7f0..c0501aa3 100644
--- a/buildconfig/BuildConfig.cpp.in
+++ b/buildconfig/BuildConfig.cpp.in
@@ -90,7 +90,7 @@ Config::Config()
HELP_URL = "@Launcher_HELP_URL@";
IMGUR_CLIENT_ID = "@Launcher_IMGUR_CLIENT_ID@";
MSA_CLIENT_ID = "@Launcher_MSA_CLIENT_ID@";
- CURSEFORGE_API_KEY = "@Launcher_CURSEFORGE_API_KEY@";
+ FLAME_API_KEY = "@Launcher_CURSEFORGE_API_KEY@";
META_URL = "@Launcher_META_URL@";
BUG_TRACKER_URL = "@Launcher_BUG_TRACKER_URL@";
diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h
index 8594e46d..2ebc8658 100644
--- a/buildconfig/BuildConfig.h
+++ b/buildconfig/BuildConfig.h
@@ -118,7 +118,7 @@ class Config {
/**
* Client API key for CurseForge
*/
- QString CURSEFORGE_API_KEY;
+ QString FLAME_API_KEY;
/**
* Metadata repository URL prefix
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 0ef641ba..ee27adea 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -712,9 +712,20 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_settings->registerSetting("CloseAfterLaunch", false);
m_settings->registerSetting("QuitAfterGameStop", false);
- // Custom MSA credentials
+ // Custom Microsoft Authentication Client ID
m_settings->registerSetting("MSAClientIDOverride", "");
- m_settings->registerSetting("CFKeyOverride", "");
+
+ // Custom Flame API Key
+ {
+ m_settings->registerSetting("CFKeyOverride", "");
+ m_settings->registerSetting("FlameKeyOverride", "");
+
+ QString flameKey = m_settings->get("CFKeyOverride").toString();
+
+ if (!flameKey.isEmpty())
+ m_settings->set("FlameKeyOverride", flameKey);
+ m_settings->reset("CFKeyOverride");
+ }
m_settings->registerSetting("UserAgentOverride", "");
// Init page provider
@@ -1586,14 +1597,14 @@ QString Application::getMSAClientID()
return BuildConfig.MSA_CLIENT_ID;
}
-QString Application::getCurseKey()
+QString Application::getFlameAPIKey()
{
- QString keyOverride = m_settings->get("CFKeyOverride").toString();
+ QString keyOverride = m_settings->get("FlameKeyOverride").toString();
if (!keyOverride.isEmpty()) {
return keyOverride;
}
- return BuildConfig.CURSEFORGE_API_KEY;
+ return BuildConfig.FLAME_API_KEY;
}
QString Application::getUserAgent()
diff --git a/launcher/Application.h b/launcher/Application.h
index 18461ad8..5eb2f832 100644
--- a/launcher/Application.h
+++ b/launcher/Application.h
@@ -164,7 +164,7 @@ public:
QString getJarPath(QString jarFile);
QString getMSAClientID();
- QString getCurseKey();
+ QString getFlameAPIKey();
QString getUserAgent();
QString getUserAgentUncached();
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp
index d93eb088..0557f2e3 100644
--- a/launcher/net/Download.cpp
+++ b/launcher/net/Download.cpp
@@ -118,7 +118,7 @@ void Download::executeTask()
request.setHeader(QNetworkRequest::UserAgentHeader, APPLICATION->getUserAgent().toUtf8());
if (request.url().host().contains("api.curseforge.com")) {
- request.setRawHeader("x-api-key", APPLICATION->getCurseKey().toUtf8());
+ request.setRawHeader("x-api-key", APPLICATION->getFlameAPIKey().toUtf8());
};
QNetworkReply* rep = m_network->get(request);
diff --git a/launcher/net/Upload.cpp b/launcher/net/Upload.cpp
index c9942a8d..2173bd08 100644
--- a/launcher/net/Upload.cpp
+++ b/launcher/net/Upload.cpp
@@ -175,7 +175,7 @@ namespace Net {
request.setHeader(QNetworkRequest::UserAgentHeader, APPLICATION->getUserAgent().toUtf8());
if (request.url().host().contains("api.curseforge.com")) {
- request.setRawHeader("x-api-key", APPLICATION->getCurseKey().toUtf8());
+ request.setRawHeader("x-api-key", APPLICATION->getFlameAPIKey().toUtf8());
}
//TODO other types of post requests ?
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
diff --git a/launcher/ui/pages/global/APIPage.cpp b/launcher/ui/pages/global/APIPage.cpp
index b889e6f7..93a265e3 100644
--- a/launcher/ui/pages/global/APIPage.cpp
+++ b/launcher/ui/pages/global/APIPage.cpp
@@ -137,8 +137,8 @@ void APIPage::loadSettings()
ui->msaClientID->setText(msaClientID);
QString metaURL = s->get("MetaURLOverride").toString();
ui->metaURL->setText(metaURL);
- QString curseKey = s->get("CFKeyOverride").toString();
- ui->curseKey->setText(curseKey);
+ QString flameKey = s->get("FlameKeyOverride").toString();
+ ui->flameKey->setText(flameKey);
QString customUserAgent = s->get("UserAgentOverride").toString();
ui->userAgentLineEdit->setText(customUserAgent);
}
@@ -167,8 +167,8 @@ void APIPage::applySettings()
}
s->set("MetaURLOverride", metaURL);
- QString curseKey = ui->curseKey->text();
- s->set("CFKeyOverride", curseKey);
+ QString flameKey = ui->flameKey->text();
+ s->set("FlameKeyOverride", flameKey);
s->set("UserAgentOverride", ui->userAgentLineEdit->text());
}
diff --git a/launcher/ui/pages/global/APIPage.ui b/launcher/ui/pages/global/APIPage.ui
index 5327771c..1ae788c7 100644
--- a/launcher/ui/pages/global/APIPage.ui
+++ b/launcher/ui/pages/global/APIPage.ui
@@ -196,7 +196,7 @@
</widget>
</item>
<item>
- <widget class="QGroupBox" name="groupBox_curse">
+ <widget class="QGroupBox" name="groupBox_flame">
<property name="enabled">
<bool>true</bool>
</property>
@@ -214,7 +214,7 @@
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
- <string>Enter a custom API Key for CurseForge here. </string>
+ <string>Enter a custom API Key for CurseForge here.</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
@@ -228,7 +228,7 @@
</widget>
</item>
<item row="1" column="0">
- <widget class="QLineEdit" name="curseKey">
+ <widget class="QLineEdit" name="flameKey">
<property name="enabled">
<bool>true</bool>
</property>