summaryrefslogtreecommitdiff
path: root/src/executableslist.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2021-01-17 18:29:17 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2021-01-18 08:21:41 -0500
commit181acfe832bef26228e33ac3a021d39528b1a4a9 (patch)
tree8d72ee70536e85361c6ebaf95cb97eef87bef0ea /src/executableslist.cpp
parent1c4d09d9e13571cf7cd7f1ed502bc069d27ed399 (diff)
renamed Refresh to TriggerRefresh, added WaitForRefresh
removed duplicate refreshDirectoryStructure() call that could never work added --logs to output logs to stdout, added final "mod organizer done" log added -i with no arguments to output the current instance name `run -e` now does an additional, case insensitive check for names fixed error being output along with --help
Diffstat (limited to 'src/executableslist.cpp')
-rw-r--r--src/executableslist.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/executableslist.cpp b/src/executableslist.cpp
index 75f29e8f..78aa981d 100644
--- a/src/executableslist.cpp
+++ b/src/executableslist.cpp
@@ -211,14 +211,22 @@ Executable &ExecutablesList::getByBinary(const QFileInfo &info)
throw std::runtime_error("invalid info");
}
-ExecutablesList::iterator ExecutablesList::find(const QString &title)
+ExecutablesList::iterator ExecutablesList::find(const QString &title, bool ci)
{
- return std::find_if(begin(), end(), [&](auto&& e) { return e.title() == title; });
+ const auto cif = ci ? Qt::CaseInsensitive : Qt::CaseSensitive;
+
+ return std::find_if(begin(), end(), [&](auto&& e) {
+ return (e.title().compare(title, cif) == 0);
+ });
}
-ExecutablesList::const_iterator ExecutablesList::find(const QString &title) const
+ExecutablesList::const_iterator ExecutablesList::find(const QString &title, bool ci) const
{
- return std::find_if(begin(), end(), [&](auto&& e) { return e.title() == title; });
+ const auto cif = ci ? Qt::CaseInsensitive : Qt::CaseSensitive;
+
+ return std::find_if(begin(), end(), [&](auto&& e) {
+ return (e.title().compare(title, cif) == 0);
+ });
}
bool ExecutablesList::titleExists(const QString &title) const