diff options
author | Lioncash <mathew1800@gmail.com> | 2018-07-18 06:12:39 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-07-18 06:13:04 +0200 |
commit | c8f3fc9a4b7060d78b8bd2cdaf4b7b0b93cc4d05 (patch) | |
tree | 9d08ca2025e739da55dcbf9f97a35f7229e58cd9 /src | |
parent | Merge pull request #675 from Subv/stencil (diff) | |
download | yuzu-c8f3fc9a4b7060d78b8bd2cdaf4b7b0b93cc4d05.tar yuzu-c8f3fc9a4b7060d78b8bd2cdaf4b7b0b93cc4d05.tar.gz yuzu-c8f3fc9a4b7060d78b8bd2cdaf4b7b0b93cc4d05.tar.bz2 yuzu-c8f3fc9a4b7060d78b8bd2cdaf4b7b0b93cc4d05.tar.lz yuzu-c8f3fc9a4b7060d78b8bd2cdaf4b7b0b93cc4d05.tar.xz yuzu-c8f3fc9a4b7060d78b8bd2cdaf4b7b0b93cc4d05.tar.zst yuzu-c8f3fc9a4b7060d78b8bd2cdaf4b7b0b93cc4d05.zip |
Diffstat (limited to '')
-rw-r--r-- | src/yuzu/game_list.cpp | 8 | ||||
-rw-r--r-- | src/yuzu/game_list.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 5a708dc73..fffa57ce1 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -141,10 +141,12 @@ GameList::SearchField::SearchField(GameList* parent) : QWidget{parent} { * @param userinput String containing all words getting checked * @return true if the haystack contains all words of userinput */ -bool GameList::containsAllWords(QString haystack, QString userinput) { - QStringList userinput_split = userinput.split(" ", QString::SplitBehavior::SkipEmptyParts); +bool GameList::containsAllWords(const QString& haystack, const QString& userinput) const { + const QStringList userinput_split = + userinput.split(' ', QString::SplitBehavior::SkipEmptyParts); + return std::all_of(userinput_split.begin(), userinput_split.end(), - [haystack](QString s) { return haystack.contains(s); }); + [&haystack](const QString& s) { return haystack.contains(s); }); } // Event in order to filter the gamelist after editing the searchfield diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index 7aff597b7..bf8486b54 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h @@ -89,7 +89,7 @@ private: void PopupContextMenu(const QPoint& menu_location); void RefreshGameDirectory(); - bool containsAllWords(QString haystack, QString userinput); + bool containsAllWords(const QString& haystack, const QString& userinput) const; SearchField* search_field; GMainWindow* main_window = nullptr; |