aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/dialogs/ProfileSetupDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/dialogs/ProfileSetupDialog.cpp')
-rw-r--r--launcher/ui/dialogs/ProfileSetupDialog.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/launcher/ui/dialogs/ProfileSetupDialog.cpp b/launcher/ui/dialogs/ProfileSetupDialog.cpp
index d7758d6d..4b0c5b76 100644
--- a/launcher/ui/dialogs/ProfileSetupDialog.cpp
+++ b/launcher/ui/dialogs/ProfileSetupDialog.cpp
@@ -163,13 +163,15 @@ void ProfileSetupDialog::checkName(const QString& name)
requestor->get(request);
}
-void ProfileSetupDialog::checkFinished(QNetworkReply::NetworkError error, QByteArray data, QList<QNetworkReply::RawHeaderPair> headers)
+void ProfileSetupDialog::checkFinished(QNetworkReply::NetworkError error,
+ QByteArray profileData,
+ [[maybe_unused]] QList<QNetworkReply::RawHeaderPair> headers)
{
auto requestor = qobject_cast<AuthRequest*>(QObject::sender());
requestor->deleteLater();
if (error == QNetworkReply::NoError) {
- auto doc = QJsonDocument::fromJson(data);
+ auto doc = QJsonDocument::fromJson(profileData);
auto root = doc.object();
auto statusValue = root.value("status").toString("INVALID");
if (statusValue == "AVAILABLE") {
@@ -202,11 +204,11 @@ void ProfileSetupDialog::setupProfile(const QString& profileName)
request.setRawHeader("Authorization", QString("Bearer %1").arg(token).toUtf8());
QString payloadTemplate("{\"profileName\":\"%1\"}");
- auto data = payloadTemplate.arg(profileName).toUtf8();
+ auto profileData = payloadTemplate.arg(profileName).toUtf8();
AuthRequest* requestor = new AuthRequest(this);
connect(requestor, &AuthRequest::finished, this, &ProfileSetupDialog::setupProfileFinished);
- requestor->post(request, data);
+ requestor->post(request, profileData);
isWorking = true;
auto button = ui->buttonBox->button(QDialogButtonBox::Cancel);
@@ -243,8 +245,8 @@ struct MojangError {
} // namespace
void ProfileSetupDialog::setupProfileFinished(QNetworkReply::NetworkError error,
- QByteArray data,
- QList<QNetworkReply::RawHeaderPair> headers)
+ QByteArray errorData,
+ [[maybe_unused]] QList<QNetworkReply::RawHeaderPair> headers)
{
auto requestor = qobject_cast<AuthRequest*>(QObject::sender());
requestor->deleteLater();
@@ -257,7 +259,7 @@ void ProfileSetupDialog::setupProfileFinished(QNetworkReply::NetworkError error,
*/
accept();
} else {
- auto parsedError = MojangError::fromJSON(data);
+ auto parsedError = MojangError::fromJSON(errorData);
ui->errorLabel->setVisible(true);
ui->errorLabel->setText(tr("The server returned the following error:") + "\n\n" + parsedError.errorMessage);
qDebug() << parsedError.rawError;