aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/auth/AccountTask.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/auth/AccountTask.cpp')
-rw-r--r--launcher/minecraft/auth/AccountTask.cpp54
1 files changed, 26 insertions, 28 deletions
diff --git a/launcher/minecraft/auth/AccountTask.cpp b/launcher/minecraft/auth/AccountTask.cpp
index 4118c3c5..4c3d6ee1 100644
--- a/launcher/minecraft/auth/AccountTask.cpp
+++ b/launcher/minecraft/auth/AccountTask.cpp
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
- * PolyMC - Minecraft Launcher
+ * Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
@@ -36,43 +36,41 @@
#include "AccountTask.h"
#include "MinecraftAccount.h"
-#include <QObject>
-#include <QString>
-#include <QJsonObject>
+#include <QByteArray>
#include <QJsonDocument>
+#include <QJsonObject>
#include <QNetworkReply>
-#include <QByteArray>
+#include <QObject>
+#include <QString>
#include <QDebug>
-AccountTask::AccountTask(AccountData *data, QObject *parent)
- : Task(parent), m_data(data)
+AccountTask::AccountTask(AccountData* data, QObject* parent) : Task(parent), m_data(data)
{
changeState(AccountTaskState::STATE_CREATED);
}
QString AccountTask::getStateMessage() const
{
- switch (m_taskState)
- {
- case AccountTaskState::STATE_CREATED:
- return "Waiting...";
- case AccountTaskState::STATE_WORKING:
- return tr("Sending request to auth servers...");
- case AccountTaskState::STATE_SUCCEEDED:
- return tr("Authentication task succeeded.");
- case AccountTaskState::STATE_OFFLINE:
- return tr("Failed to contact the authentication server.");
- case AccountTaskState::STATE_DISABLED:
- return tr("Client ID has changed. New session needs to be created.");
- case AccountTaskState::STATE_FAILED_SOFT:
- return tr("Encountered an error during authentication.");
- case AccountTaskState::STATE_FAILED_HARD:
- return tr("Failed to authenticate. The session has expired.");
- case AccountTaskState::STATE_FAILED_GONE:
- return tr("Failed to authenticate. The account no longer exists.");
- default:
- return tr("...");
+ switch (m_taskState) {
+ case AccountTaskState::STATE_CREATED:
+ return "Waiting...";
+ case AccountTaskState::STATE_WORKING:
+ return tr("Sending request to auth servers...");
+ case AccountTaskState::STATE_SUCCEEDED:
+ return tr("Authentication task succeeded.");
+ case AccountTaskState::STATE_OFFLINE:
+ return tr("Failed to contact the authentication server.");
+ case AccountTaskState::STATE_DISABLED:
+ return tr("Client ID has changed. New session needs to be created.");
+ case AccountTaskState::STATE_FAILED_SOFT:
+ return tr("Encountered an error during authentication.");
+ case AccountTaskState::STATE_FAILED_HARD:
+ return tr("Failed to authenticate. The session has expired.");
+ case AccountTaskState::STATE_FAILED_GONE:
+ return tr("Failed to authenticate. The account no longer exists.");
+ default:
+ return tr("...");
}
}
@@ -82,7 +80,7 @@ bool AccountTask::changeState(AccountTaskState newState, QString reason)
// FIXME: virtual method invoked in constructor.
// We want that behavior, but maybe make it less weird?
setStatus(getStateMessage());
- switch(newState) {
+ switch (newState) {
case AccountTaskState::STATE_CREATED: {
m_data->errorString.clear();
return true;