diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-17 17:33:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-01-17 22:41:46 +0100 |
| commit | 7e6fa2a2d848f81d82d6ae5151b5ef851b4b720a (patch) | |
| tree | 2d7dbb8964dda29c817c46ab49cade1235c8dd39 /src | |
| parent | 45a932e0756a9e1f708606d9704425c8f5c5aeb5 (diff) | |
Use Collator for recipients search (#2426).
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/recipients_panel.cc | 13 | ||||
| -rw-r--r-- | src/wx/recipients_panel.h | 3 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/wx/recipients_panel.cc b/src/wx/recipients_panel.cc index 943d55c6c..485a0f94e 100644 --- a/src/wx/recipients_panel.cc +++ b/src/wx/recipients_panel.cc @@ -105,15 +105,10 @@ RecipientsPanel::setup_sensitivity () void RecipientsPanel::add_recipient (shared_ptr<DKDMRecipient> r) { - string search = wx_to_std (_search->GetValue()); - transform (search.begin(), search.end(), search.begin(), ::tolower); - - if (!search.empty()) { - string name = r->name; - transform (name.begin(), name.end(), name.begin(), ::tolower); - if (name.find(search) == string::npos) { - return; - } + string const search = wx_to_std(_search->GetValue()); + + if (!search.empty() && !_collator.find(search, r->name)) { + return; } _recipients[_targets->AppendItem(_root, std_to_wx(r->name))] = r; diff --git a/src/wx/recipients_panel.h b/src/wx/recipients_panel.h index 0b2a6a4b7..6e1f1408f 100644 --- a/src/wx/recipients_panel.h +++ b/src/wx/recipients_panel.h @@ -19,6 +19,7 @@ */ +#include "lib/collator.h" #include "lib/dkdm_recipient.h" #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS @@ -67,4 +68,6 @@ private: RecipientMap _selected; bool _ignore_selection_change; + + Collator _collator; }; |
