kinfocenter: fallback to UDI for button device text

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-06-10 22:42:49 +03:00
parent c9dbe0b9b6
commit 0b5adb0a39

View file

@ -77,6 +77,12 @@ void SolDevice::setDefaultDeviceText()
if (!label.isEmpty()) {
ddtString = label;
}
} else if(tiedDevice.isDeviceInterface(Solid::DeviceInterface::Button) && ddtString.isEmpty()) {
// button that is not on keyboard for example does not have product/vendor
QString label = SolDevice::udi().section("/", -1, -1);
if (!label.isEmpty()) {
ddtString = label;
}
}
}
setText(0,ddtString);