Utils: Use more views in Id setup

Since this means that StringBuilder expressions are not usable
as arguments anymore, use .withSuffix() more extensively.

This makes this "unusual" construction also a bit better findable.

No measurable performance gain or loss in either direction.

Change-Id: I04508e77764455bd9d3a21eda63bc6de01508e4b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2024-07-23 19:11:52 +02:00
parent f64440e4b8
commit 87280f25ce
18 changed files with 69 additions and 75 deletions

View File

@@ -75,8 +75,9 @@ void DeviceDetector::handleDeviceEvent(QdbDeviceTracker::DeviceEventType eventTy
return;
}
const Utils::Id deviceId = Constants::QdbHardwareDevicePrefix.withSuffix(':' + serial);
const auto messagePrefix = Tr::tr("Device \"%1\" %2").arg(serial);
const Utils::Id deviceId =
Utils::Id(Constants::QdbHardwareDevicePrefix).withSuffix(':').withSuffix(serial);
const QString messagePrefix = Tr::tr("Device \"%1\" %2").arg(serial);
DeviceManager * const dm = DeviceManager::instance();
if (eventType == QdbDeviceTracker::NewDevice) {