Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into demo
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: {
|
||||
|
||||
@@ -75,7 +75,7 @@ class AccountList : public QAbstractListModel {
|
||||
virtual Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
virtual bool setData(const QModelIndex& index, const QVariant& value, int role) override;
|
||||
|
||||
void addAccount(const MinecraftAccountPtr account);
|
||||
void addAccount(MinecraftAccountPtr account);
|
||||
void removeAccount(QModelIndex index);
|
||||
int findAccountByProfileId(const QString& profileId) const;
|
||||
MinecraftAccountPtr getAccountByProfileName(const QString& profileName) const;
|
||||
|
||||
@@ -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