Qt: Fix serial mismatch error when verifying

This commit is contained in:
Stenzek
2025-10-12 23:28:24 +10:00
parent c117059c82
commit 8ed329ff1f

View File

@@ -65,7 +65,8 @@ GameSummaryWidget::GameSummaryWidget(const GameList::Entry* entry, SettingsWindo
populateUi(entry);
connect(m_ui.compatibilityComments, &QAbstractButton::clicked, this, &GameSummaryWidget::onCompatibilityCommentsClicked);
connect(m_ui.compatibilityComments, &QAbstractButton::clicked, this,
&GameSummaryWidget::onCompatibilityCommentsClicked);
connect(m_ui.inputProfile, &QComboBox::currentIndexChanged, this, &GameSummaryWidget::onInputProfileChanged);
connect(m_ui.editInputProfile, &QAbstractButton::clicked, this, &GameSummaryWidget::onEditInputProfileClicked);
connect(m_ui.computeHashes, &QAbstractButton::clicked, this, &GameSummaryWidget::onComputeHashClicked);
@@ -119,7 +120,8 @@ void GameSummaryWidget::populateUi(const GameList::Entry* entry)
m_path = entry->path;
m_ui.path->setText(QString::fromStdString(entry->path));
m_ui.serial->setText(QtUtils::StringViewToQString(TinyString::from_format("{} ({:016X})", entry->serial, entry->hash)));
m_ui.serial->setText(
QtUtils::StringViewToQString(TinyString::from_format("{} ({:016X})", entry->serial, entry->hash)));
m_ui.title->setText(QtUtils::StringViewToQString(entry->GetDisplayTitle(GameList::ShouldShowLocalizedTitles())));
m_ui.region->setCurrentIndex(static_cast<int>(entry->region));
m_ui.entryType->setCurrentIndex(static_cast<int>(entry->type));
@@ -566,7 +568,7 @@ void GameSummaryWidget::onComputeHashClicked()
if (!found_revision.empty())
text = tr("Revision: %1").arg(found_revision.empty() ? tr("N/A") : QString::fromStdString(found_revision));
if (found_serial != m_ui.serial->text().toStdString())
if (found_serial != m_dialog->getGameSerial())
{
if (found_serial.empty())
{
@@ -574,8 +576,9 @@ void GameSummaryWidget::onComputeHashClicked()
}
else
{
const QString mismatch_str =
tr("Serial Mismatch: %1 vs %2").arg(QString::fromStdString(found_serial)).arg(m_ui.serial->text());
const QString mismatch_str = tr("Serial Mismatch: %1 vs %2")
.arg(QString::fromStdString(found_serial))
.arg(QString::fromStdString(m_dialog->getGameSerial()));
if (!text.isEmpty())
text = QStringLiteral("%1 | %2").arg(mismatch_str).arg(text);
else