mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 13:17:41 +02:00
Merge pull request #1751 from LocalSpook/account_type
This commit is contained in:
@ -283,9 +283,15 @@ QVariant AccountList::data(const QModelIndex& index, int role) const
|
||||
return account->accountDisplayString();
|
||||
|
||||
case TypeColumn: {
|
||||
auto typeStr = account->typeString();
|
||||
typeStr[0] = typeStr[0].toUpper();
|
||||
return typeStr;
|
||||
switch (account->accountType()) {
|
||||
case AccountType::MSA: {
|
||||
return tr("MSA", "Account type");
|
||||
}
|
||||
case AccountType::Offline: {
|
||||
return tr("Offline", "Account type");
|
||||
}
|
||||
}
|
||||
return tr("Unknown", "Account type");
|
||||
}
|
||||
|
||||
case StatusColumn: {
|
||||
|
@ -52,6 +52,7 @@
|
||||
|
||||
#include "flows/MSA.h"
|
||||
#include "flows/Offline.h"
|
||||
#include "minecraft/auth/AccountData.h"
|
||||
|
||||
MinecraftAccount::MinecraftAccount(QObject* parent) : QObject(parent)
|
||||
{
|
||||
@ -185,7 +186,7 @@ void MinecraftAccount::authFailed(QString reason)
|
||||
// NOTE: this doesn't do much. There was an error of some sort.
|
||||
} break;
|
||||
case AccountTaskState::STATE_FAILED_HARD: {
|
||||
if (isMSA()) {
|
||||
if (accountType() == AccountType::MSA) {
|
||||
data.msaToken.token = QString();
|
||||
data.msaToken.refresh_token = QString();
|
||||
data.msaToken.validity = Katabasis::Validity::None;
|
||||
|
@ -118,9 +118,7 @@ class MinecraftAccount : public QObject, public Usable {
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
bool isMSA() const { return data.type == AccountType::MSA; }
|
||||
|
||||
bool isOffline() const { return data.type == AccountType::Offline; }
|
||||
[[nodiscard]] AccountType accountType() const noexcept { return data.type; }
|
||||
|
||||
bool ownsMinecraft() const { return data.minecraftEntitlement.ownsMinecraft; }
|
||||
|
||||
|
Reference in New Issue
Block a user