Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
4 years ago
by
Patrick José Pereira
Browse files
Options
Download
Email Patches
Plain Diff
Vehicle: Fix deprecated QString::sprintf
Signed-off-by:
Patrick José Pereira
<
patrickelectric@gmail.com
>
parent
609fdda9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Vehicle/Vehicle.cc
+2
-3
src/Vehicle/Vehicle.cc
with
2 additions
and
3 deletions
+2
-3
src/Vehicle/Vehicle.cc
+
2
-
3
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
;
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets