DolphinQt/CheatSearchWidget: Drop whitespace when parsing integers and floats from the user.

This commit is contained in:
Admiral H. Curtiss 2022-03-25 09:48:16 +01:00
parent 7f2fed0f68
commit 1942629d9a
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 4 additions and 1 deletions

View File

@ -276,7 +276,10 @@ void CheatSearchWidget::OnNextScanClicked()
m_session->SetCompareType(m_compare_type_dropdown->currentData().value<Cheats::CompareType>()); m_session->SetCompareType(m_compare_type_dropdown->currentData().value<Cheats::CompareType>());
if (filter_type == Cheats::FilterType::CompareAgainstSpecificValue) if (filter_type == Cheats::FilterType::CompareAgainstSpecificValue)
{ {
if (!m_session->SetValueFromString(m_given_value_text->text().toStdString(), QString search_value = m_given_value_text->text();
if (m_session->IsIntegerType() || m_session->IsFloatingType())
search_value = search_value.simplified().remove(QLatin1Char(' '));
if (!m_session->SetValueFromString(search_value.toStdString(),
m_parse_values_as_hex_checkbox->isChecked())) m_parse_values_as_hex_checkbox->isChecked()))
{ {
m_info_label_1->setText(tr("Failed to parse given value into target data type.")); m_info_label_1->setText(tr("Failed to parse given value into target data type."));