From a5160ba7dfa6c8164f1f2ecc77808f7e5e238806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 5 Jun 2020 12:55:49 -0300 Subject: [PATCH] Vehicle: Fix deprecated QString::sprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/Vehicle/Vehicle.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 9a2e05136..0e4232168 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1535,7 +1535,7 @@ QString Vehicle::vehicleUIDStr() { QString uid; uint8_t* pUid = (uint8_t*)(void*)&_uid; - uid.sprintf("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", + uid.asprintf("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", pUid[0] & 0xff, pUid[1] & 0xff, pUid[2] & 0xff, @@ -4102,8 +4102,7 @@ QString Vehicle::hobbsMeter() int hours = hobbsTimeSeconds / 3600; int minutes = (hobbsTimeSeconds % 3600) / 60; int seconds = hobbsTimeSeconds % 60; - QString timeStr; - timeStr.sprintf("%04d:%02d:%02d", hours, minutes, seconds); + QString timeStr = QString::asprintf("%04d:%02d:%02d", hours, minutes, seconds); qCDebug(VehicleLog) << "Hobbs Meter:" << timeStr << "(" << factHi->rawValue().toUInt() << factLo->rawValue().toUInt() << ")"; return timeStr; } -- 2.22.0