diff options
| author | Silarn <jrim@rimpo.org> | 2019-01-27 23:04:58 -0600 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-02-18 21:28:07 -0600 |
| commit | b4a9dd410c44e99dd1eb6775deea50f042899e15 (patch) | |
| tree | febe64910f661ad0d1077f28502d88317943b6c2 /src/mainwindow.cpp | |
| parent | b6805f2730fb37c1c3a6f3b61808fab27bfcdc9d (diff) | |
Fix issue with endorsement response parsing
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c2b61614..f875c95c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5569,17 +5569,15 @@ void MainWindow::nxmDescriptionAvailable(QString gameName, int modID, QVariant u void MainWindow::nxmEndorsementToggled(QString, int, QVariant, QVariant resultData, int) { QMap results = resultData.toMap(); - if (results["code"].toInt() == 200 || results["code"].toInt() == 201) { - if (results["status"].toString().compare("Endorsed") == 0) { - QMessageBox::information(this, tr("Thank you!"), tr("Thank you for your endorsement!")); - } else if (results["status"].toString().compare("Abstained") == 0) { - QMessageBox::information(this, tr("Okay."), tr("This mod will not be endorsed and will no longer ask you to endorse.")); - } - ui->actionEndorseMO->setVisible(false); - if (!disconnect(sender(), SIGNAL(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)), - this, SLOT(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)))) { - qCritical("failed to disconnect endorsement slot"); - } + if (results["status"].toString().compare("Endorsed") == 0) { + QMessageBox::information(this, tr("Thank you!"), tr("Thank you for your endorsement!")); + } else if (results["status"].toString().compare("Abstained") == 0) { + QMessageBox::information(this, tr("Okay."), tr("This mod will not be endorsed and will no longer ask you to endorse.")); + } + ui->actionEndorseMO->setVisible(false); + if (!disconnect(sender(), SIGNAL(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)), + this, SLOT(nxmEndorsementToggled(QString, int, QVariant, QVariant, int)))) { + qCritical("failed to disconnect endorsement slot"); } } |
