Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
a5160ba7
Commit
a5160ba7
authored
Jun 05, 2020
by
Patrick José Pereira
Browse files
Vehicle: Fix deprecated QString::sprintf
Signed-off-by:
Patrick José Pereira
<
patrickelectric@gmail.com
>
parent
609fdda9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Vehicle/Vehicle.cc
View file @
a5160ba7
...
...
@@ -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
.
a
sprintf
(
"%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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment