fix(pulseaudio) use case-insensitive comparison for icon lookup

This commit is contained in:
Aleksei Bavshin 2019-03-14 18:08:12 -07:00
parent 6d2dcd8ac7
commit 492d151079

View File

@ -187,8 +187,10 @@ const std::string waybar::modules::Pulseaudio::getPortIcon() const
"hifi", "hifi",
"phone", "phone",
}; };
std::string nameLC = port_name_;
std::transform(nameLC.begin(), nameLC.end(), nameLC.begin(), ::tolower);
for (auto const& port : ports) { for (auto const& port : ports) {
if (port_name_.find(port) != std::string::npos) { if (nameLC.find(port) != std::string::npos) {
return port; return port;
} }
} }