This commit is contained in:
BruebachL 2026-09-10 16:22:42 +02:00 • committed by GitHub
commit 1dc1c502a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 880 additions and 30 deletions

View file

@ -146,6 +146,19 @@ void ServersSettings::setFPPlayerName(QString playerName)
setValue(playerName, "fpPlayerName");
}
void ServersSettings::setServerPassword(const QString &saveName, const QString &password)
{
const int index = getPrevioushostindex(saveName);
if (index >= 0) {
setValue(password, QString("password%1").arg(index), "server", "server_details");
} else {
// A credential write that silently no-ops is hard to diagnose from a
// bug report; surface a mismatched profile name instead.
qCWarning(ServersSettingsLog) << "setServerPassword() could not find profile:" << saveName
<< "- password not saved";
}
}
QString ServersSettings::getFPPlayerName(QString defaultName) const
{
QVariant name = getValue("fpPlayerName");

View file

@ -46,6 +46,8 @@ public:
void setFPHostName(QString hostname);
void setFPPort(QString port);
void setFPPlayerName(QString playerName);
//! \brief Store a password (or a "$scrypt$..." verifier) for the given saved server.
void setServerPassword(const QString &saveName, const QString &password);
void addNewServer(const QString &saveName,
const QString &serv,
const QString &port,