Skip to content

Commit

Permalink
Improved the search box event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Jun 1, 2024
1 parent 973b73c commit 4932a5e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/multimenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,13 @@ void addMultiRequest(const char *searchDir, const char *fileExtension, UDWORD mo
searchBox->setPlaceholder(_("Search for map"));
searchBox->setString(WzString::fromUtf8(current_searchString));

searchBox->setOnReturnHandler([searchDir, fileExtension, mode, numPlayers](W_EDITBOX& widg) {
searchBox->setOnEditingStoppedHandler([searchDir, fileExtension, mode, numPlayers](W_EDITBOX& widg) {
const std::string &value = widg.getString().toUtf8();

Check failure on line 487 in src/multimenu.cpp

View workflow job for this annotation

GitHub Actions / Fedora :LATEST [GCC]

possibly dangling reference to a temporary [-Werror=dangling-reference]

Check failure on line 487 in src/multimenu.cpp

View workflow job for this annotation

GitHub Actions / Arch :LATEST [GCC]

possibly dangling reference to a temporary [-Werror=dangling-reference]

Check failure on line 487 in src/multimenu.cpp

View workflow job for this annotation

GitHub Actions / Alpine :LATEST [GCC]

possibly dangling reference to a temporary [-Werror=dangling-reference]

Check failure on line 487 in src/multimenu.cpp

View workflow job for this annotation

GitHub Actions / Fedora :LATEST [GCC -m32]

possibly dangling reference to a temporary [-Werror=dangling-reference]
if (value == current_searchString) {
return;
}
closeMultiRequester();
addMultiRequest(searchDir, fileExtension, mode, numPlayers, widg.getString().toUtf8());
addMultiRequest(searchDir, fileExtension, mode, numPlayers, value);
});

multiRequestUp = true;
Expand Down

0 comments on commit 4932a5e

Please sign in to comment.