Fixed an issue where leading and trailing spaces were not trimmed when defining the ROM directory.

This commit is contained in:
Leon Styhre 2021-12-26 17:10:30 +01:00
parent 246e9ae8be
commit 44cf76095f

View file

@ -143,7 +143,8 @@ void ViewController::noGamesDialog()
mWindow->pushGui(new GuiTextEditKeyboardPopup(
mWindow, HelpStyle(), "ENTER ROM DIRECTORY PATH", currentROMDirectory,
[this](const std::string& newROMDirectory) {
Settings::getInstance()->setString("ROMDirectory", newROMDirectory);
Settings::getInstance()->setString("ROMDirectory",
Utils::String::trim(newROMDirectory));
Settings::getInstance()->saveFile();
#if defined(_WIN64)
mRomDirectory =
@ -166,7 +167,8 @@ void ViewController::noGamesDialog()
mWindow->pushGui(new GuiTextEditPopup(
mWindow, HelpStyle(), "ENTER ROM DIRECTORY PATH", currentROMDirectory,
[this](const std::string& newROMDirectory) {
Settings::getInstance()->setString("ROMDirectory", newROMDirectory);
Settings::getInstance()->setString("ROMDirectory",
Utils::String::trim(newROMDirectory));
Settings::getInstance()->saveFile();
#if defined(_WIN64)
mRomDirectory =