mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-31 04:25:40 +00:00
Leading and trailing whitespaces are now trimmed from refined scraper searches.
This commit is contained in:
parent
49075f3fc4
commit
8f82809a89
|
@ -777,7 +777,16 @@ void GuiScraperSearch::updateThumbnail()
|
||||||
|
|
||||||
void GuiScraperSearch::openInputScreen(ScraperSearchParams& params)
|
void GuiScraperSearch::openInputScreen(ScraperSearchParams& params)
|
||||||
{
|
{
|
||||||
auto searchForFunc = [&](const std::string& name) {
|
auto searchForFunc = [&](std::string name) {
|
||||||
|
// Trim leading and trailing whitespaces.
|
||||||
|
name.erase(name.begin(), std::find_if(name.begin(), name.end(), [](char c) {
|
||||||
|
return !std::isspace(static_cast<unsigned char>(c));
|
||||||
|
}));
|
||||||
|
name.erase(std::find_if(name.rbegin(), name.rend(),
|
||||||
|
[](char c) { return !std::isspace(static_cast<unsigned char>(c)); })
|
||||||
|
.base(),
|
||||||
|
name.end());
|
||||||
|
|
||||||
stop();
|
stop();
|
||||||
mRefinedSearch = true;
|
mRefinedSearch = true;
|
||||||
params.nameOverride = name;
|
params.nameOverride = name;
|
||||||
|
|
Loading…
Reference in a new issue