Skip to content

Commit

Permalink
Qt: trim whitespace from textinput before writing to config
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Jan 22, 2024
1 parent a6e046c commit 93f5154
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rpcs3/rpcs3qt/emu_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,12 @@ void emu_settings::EnhanceLineEdit(QLineEdit* edit, emu_settings_type type)

connect(edit, &QLineEdit::textChanged, this, [type, this](const QString &text)
{
SetSetting(type, sstr(text));
const QString trimmed = text.trimmed();
if (trimmed.size() != text.size())
{
cfg_log.warning("EnhanceLineEdit '%s' input was trimmed", cfg_adapter::get_setting_name(type));
}
SetSetting(type, sstr(trimmed));
});

connect(this, &emu_settings::RestoreDefaultsSignal, edit, [this, edit, type]()
Expand Down

0 comments on commit 93f5154

Please sign in to comment.