]*class=["|']frame__chara__face["|'][^>]*>\s*
![]()
]*src=["|']([^"']*))lit"));
+ const QRegularExpressionMatch match = re.match(document);
- if (avatarRequest.url().isEmpty()) {
- return;
+ if (match.hasCaptured(1)) {
+ const QString newAvatarUrl = match.captured(1);
+
+ const QNetworkRequest avatarRequest = QNetworkRequest(QUrl(newAvatarUrl));
+ Utility::printRequest(QStringLiteral("GET"), avatarRequest);
+
+ auto avatarReply = m_launcher.mgr()->get(avatarRequest);
+ connect(avatarReply, &QNetworkReply::finished, [this, filename, avatarReply] {
+ QFile file(filename);
+ file.open(QIODevice::ReadWrite);
+ file.write(avatarReply->readAll());
+ file.close();
+
+ m_avatarUrl = QStringLiteral("file:///%1").arg(filename);
+ Q_EMIT avatarUrlChanged();
+ });
}
-
- auto avatarReply = m_launcher.mgr()->get(avatarRequest);
- connect(avatarReply, &QNetworkReply::finished, [this, filename, avatarReply] {
- QFile file(filename);
- file.open(QIODevice::ReadWrite);
- file.write(avatarReply->readAll());
- file.close();
-
- m_avatarUrl = QStringLiteral("file:///%1").arg(filename);
- Q_EMIT avatarUrlChanged();
- });
}
});
} else {
diff --git a/launcher/src/launchersettings.cpp b/launcher/src/launchersettings.cpp
index eae1693..777bfbc 100644
--- a/launcher/src/launchersettings.cpp
+++ b/launcher/src/launchersettings.cpp
@@ -107,17 +107,17 @@ void LauncherSettings::setSquareEnixLoginServer(const QString &value)
}
}
-QString LauncherSettings::xivApiServer() const
+QString LauncherSettings::mainServer() const
{
- return m_config->xivApiServer();
+ return m_config->mainServer();
}
-void LauncherSettings::setXivApiServer(const QString &value)
+void LauncherSettings::setMainServer(const QString &value)
{
- if (value != m_config->xivApiServer()) {
- m_config->setXivApiServer(value);
+ if (value != m_config->mainServer()) {
+ m_config->setMainServer(value);
m_config->save();
- Q_EMIT xivApiServerChanged();
+ Q_EMIT mainServerChanged();
}
}
diff --git a/launcher/src/squareenixlogin.cpp b/launcher/src/squareenixlogin.cpp
index 4192055..a2705d0 100644
--- a/launcher/src/squareenixlogin.cpp
+++ b/launcher/src/squareenixlogin.cpp
@@ -237,7 +237,7 @@ QCoro::Task
> SquareEnixLogin::getStor
// fetches Steam username
if (m_info->profile->account()->license() == Account::GameLicense::WindowsSteam) {
- const QRegularExpression re(QStringLiteral(R"lit(.*)""\/>)lit"));
+ const static QRegularExpression re(QStringLiteral(R"lit(.*)""\/>)lit"));
const QRegularExpressionMatch match = re.match(str);
if (match.hasMatch()) {
@@ -249,7 +249,7 @@ QCoro::Task> SquareEnixLogin::getStor
m_username = m_info->username;
}
- const QRegularExpression re(QStringLiteral(R"lit(\t<\s*input .* name="_STORED_" value="(?.*)">)lit"));
+ const static QRegularExpression re(QStringLiteral(R"lit(\t<\s*input .* name="_STORED_" value="(?.*)">)lit"));
const QRegularExpressionMatch match = re.match(str);
if (match.hasMatch()) {
co_return StoredInfo{match.captured(1), url};
@@ -296,7 +296,7 @@ QCoro::Task SquareEnixLogin::loginOAuth()
const QString str = QString::fromUtf8(reply->readAll());
- const QRegularExpression re(QStringLiteral(R"lit(window.external.user\("login=auth,ok,(?.*)\);)lit"));
+ const static QRegularExpression re(QStringLiteral(R"lit(window.external.user\("login=auth,ok,(?.*)\);)lit"));
const QRegularExpressionMatch match = re.match(str);
if (match.hasMatch()) {
const auto parts = match.captured(1).split(','_L1);
@@ -320,7 +320,7 @@ QCoro::Task SquareEnixLogin::loginOAuth()
co_return true;
} else {
- const QRegularExpression errorRe(QStringLiteral(R"lit(window.external.user\("login=auth,ng,err,(?.*)\);)lit"));
+ const static QRegularExpression errorRe(QStringLiteral(R"lit(window.external.user\("login=auth,ng,err,(?.*)\);)lit"));
const QRegularExpressionMatch errorMatch = errorRe.match(str);
if (errorMatch.hasCaptured(1)) {
diff --git a/launcher/ui/Settings/DeveloperSettings.qml b/launcher/ui/Settings/DeveloperSettings.qml
index a1359f2..38f57f0 100644
--- a/launcher/ui/Settings/DeveloperSettings.qml
+++ b/launcher/ui/Settings/DeveloperSettings.qml
@@ -114,7 +114,7 @@ FormCard.FormCardPage {
FormCard.FormTextFieldDelegate {
id: mainServerDelegate
- label: i18n("SE Main Server")
+ label: i18n("SE Main Server (ffxiv.com)")
text: LauncherCore.settings.squareEnixServer
onTextChanged: LauncherCore.settings.squareEnixServer = text
}
@@ -127,22 +127,22 @@ FormCard.FormCardPage {
FormCard.FormTextFieldDelegate {
id: loginServerDelegate
- label: i18n("SE Login Server")
+ label: i18n("SE Login Server (square-enix.com)")
text: LauncherCore.settings.squareEnixLoginServer
onTextChanged: LauncherCore.settings.squareEnixLoginServer = text
}
FormCard.FormDelegateSeparator {
above: loginServerDelegate
- below: xivApiServerDelegate
+ below: mainServerDelegate
}
FormCard.FormTextFieldDelegate {
- id: xivApiServerDelegate
+ id: mainServerDelegate
- label: i18n("XIV Api Server")
- text: LauncherCore.settings.xivApiServer
- onTextChanged: LauncherCore.settings.xivApiServer = text
+ label: i18n("Main Server (finalfantasyxiv.com)")
+ text: LauncherCore.settings.mainServer
+ onTextChanged: LauncherCore.settings.mainServer = text
}
}
}
\ No newline at end of file