mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
FIX: support UTF-8 search for devices
jira: [none] Change-Id: I29c6509c0d06f238f0d42d0c5422fb0686a598ca (cherry picked from commit bc96302f12b1435cb8417f87dc09a829271821a8)
This commit is contained in:
@@ -769,15 +769,19 @@ void SelectMachinePopup::update_user_devices()
|
|||||||
|
|
||||||
bool SelectMachinePopup::search_for_printer(MachineObject* obj)
|
bool SelectMachinePopup::search_for_printer(MachineObject* obj)
|
||||||
{
|
{
|
||||||
std::string search_text = std::string((m_search_bar->GetValue()).mb_str());
|
const std::string& search_text = m_search_bar->GetValue().ToStdString();
|
||||||
if (search_text.empty()) {
|
if (search_text.empty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
auto name = obj->dev_name;
|
|
||||||
auto ip = obj->dev_ip;
|
const auto& name = wxString::FromUTF8(obj->dev_name).ToStdString();
|
||||||
auto name_it = name.find(search_text);
|
const auto& name_it = name.find(search_text);
|
||||||
auto ip_it = ip.find(search_text);
|
if (name_it != std::string::npos) {
|
||||||
if ((name_it != std::string::npos)||(ip_it != std::string::npos)) {
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto& ip_it = obj->dev_ip.find(search_text);
|
||||||
|
if (ip_it != std::string::npos) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user