Use Collator for recipients search (#2426).
[dcpomatic.git] / src / wx / recipients_panel.cc
index 943d55c6c08a7191157bcbc2827acc7cf395bf25..485a0f94e1ea65f8219f7bea1e9c690b6e157302 100644 (file)
@@ -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;