mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Merge pull request #8233 from JosJuice/stringutil-string-view
StringUtil: Use std::string_view more
This commit is contained in:
@ -141,7 +141,7 @@ static std::string GetDeviceRefName(IOHIDDeviceRef inIOHIDDeviceRef)
|
||||
{
|
||||
const NSString* name = reinterpret_cast<const NSString*>(
|
||||
IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey)));
|
||||
return (name != nullptr) ? StripSpaces([name UTF8String]) : "Unknown device";
|
||||
return (name != nullptr) ? std::string(StripSpaces([name UTF8String])) : "Unknown device";
|
||||
}
|
||||
|
||||
static void DeviceRemovalCallback(void* inContext, IOReturn inResult, void* inSender,
|
||||
|
@ -164,7 +164,7 @@ std::string Joystick::Button::GetName() const
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << IOHIDElementGetUsage(m_element);
|
||||
return std::string("Button ") + StripSpaces(s.str());
|
||||
return std::string("Button ").append(StripSpaces(s.str()));
|
||||
}
|
||||
|
||||
Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction dir)
|
||||
|
@ -313,7 +313,7 @@ std::string evdevDevice::Button::GetName() const
|
||||
{
|
||||
const char* name = libevdev_event_code_get_name(EV_KEY, m_code);
|
||||
if (name)
|
||||
return StripSpaces(name);
|
||||
return std::string(StripSpaces(name));
|
||||
}
|
||||
// But controllers use codes above 0x100, and the standard label often doesn't match.
|
||||
// We are better off with Button 0 and so on.
|
||||
|
Reference in New Issue
Block a user