chore(clang-tidy): modernize the code

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-05-10 23:16:46 +03:00
parent 170d59de2a
commit 1af838db2e
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
38 changed files with 1088 additions and 956 deletions

View file

@ -1,6 +1,7 @@
#include <QDebug>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <utility>
#include "minecraft/auth/AccountData.h"
#include "minecraft/auth/steps/EntitlementsStep.h"
@ -17,7 +18,7 @@
#include <Application.h>
AuthFlow::AuthFlow(AccountData* data, Action action) : Task(), m_data(data)
AuthFlow::AuthFlow(AccountData* data, Action action) : m_data(data)
{
if (data->type == AccountType::MSA) {
if (action == Action::DeviceCode) {
@ -75,11 +76,12 @@ void AuthFlow::nextStep()
void AuthFlow::stepFinished(AccountTaskState resultingState, QString message)
{
if (changeState(resultingState, message))
if (changeState(resultingState, std::move(message))) {
nextStep();
}
}
bool AuthFlow::changeState(AccountTaskState newState, QString reason)
bool AuthFlow::changeState(AccountTaskState newState, const QString& reason)
{
m_taskState = newState;
setDetails(reason);
@ -148,8 +150,9 @@ bool AuthFlow::changeState(AccountTaskState newState, QString reason)
}
bool AuthFlow::abort()
{
if (m_currentStep)
if (m_currentStep) {
m_currentStep->abort();
}
emitAborted();
return true;
}