1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 04:07:46 +00:00

Replace usage of LauncherCore::isSteamDeck with Utility::isSteamDeck

This calls into the function anyway, no need to use this version of the
function.
This commit is contained in:
Joshua Goins 2024-08-22 18:48:29 -04:00
parent c602f01062
commit b7aafea3ea

View file

@ -235,7 +235,7 @@ QString Account::getConfigPath() const
void Account::setKeychainValue(const QString &key, const QString &value) void Account::setKeychainValue(const QString &key, const QString &value)
{ {
if (m_launcher.isSteamDeck()) { if (Utility::isSteamDeck()) {
auto stateConfig = KSharedConfig::openStateConfig(); auto stateConfig = KSharedConfig::openStateConfig();
stateConfig->group(QStringLiteral("Passwords")).writeEntry(m_key + QStringLiteral("-") + key, value); stateConfig->group(QStringLiteral("Passwords")).writeEntry(m_key + QStringLiteral("-") + key, value);
@ -248,7 +248,6 @@ void Account::setKeychainValue(const QString &key, const QString &value)
#else #else
job->setKey(m_key + QStringLiteral("-") + key); job->setKey(m_key + QStringLiteral("-") + key);
#endif #endif
job->setInsecureFallback(m_launcher.isSteamDeck()); // The Steam Deck does not have secrets provider in Game Mode
job->start(); job->start();
connect(job, &QKeychain::WritePasswordJob::finished, this, [job] { connect(job, &QKeychain::WritePasswordJob::finished, this, [job] {
@ -261,7 +260,7 @@ void Account::setKeychainValue(const QString &key, const QString &value)
QCoro::Task<QString> Account::getKeychainValue(const QString &key) QCoro::Task<QString> Account::getKeychainValue(const QString &key)
{ {
if (m_launcher.isSteamDeck()) { if (Utility::isSteamDeck()) {
co_return KSharedConfig::openStateConfig()->group(QStringLiteral("Passwords")).readEntry(m_key + QStringLiteral("-") + key); co_return KSharedConfig::openStateConfig()->group(QStringLiteral("Passwords")).readEntry(m_key + QStringLiteral("-") + key);
} else { } else {
auto job = new QKeychain::ReadPasswordJob(QStringLiteral("Astra"), this); auto job = new QKeychain::ReadPasswordJob(QStringLiteral("Astra"), this);
@ -270,7 +269,6 @@ QCoro::Task<QString> Account::getKeychainValue(const QString &key)
#else #else
job->setKey(m_key + QStringLiteral("-") + key); job->setKey(m_key + QStringLiteral("-") + key);
#endif #endif
job->setInsecureFallback(m_launcher.isSteamDeck()); // The Steam Deck does not have secrets provider in Game Mode
job->start(); job->start();
co_await qCoro(job, &QKeychain::ReadPasswordJob::finished); co_await qCoro(job, &QKeychain::ReadPasswordJob::finished);