Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
ee22373c
Commit
ee22373c
authored
Sep 18, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Missing const, plus log output bug fix
parent
d49cb252
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
JsonHelper.cc
src/JsonHelper.cc
+2
-2
JsonHelper.h
src/JsonHelper.h
+1
-1
No files found.
src/JsonHelper.cc
View file @
ee22373c
...
@@ -101,13 +101,13 @@ bool JsonHelper::validateKeyTypes(const QJsonObject& jsonObject, const QStringLi
...
@@ -101,13 +101,13 @@ bool JsonHelper::validateKeyTypes(const QJsonObject& jsonObject, const QStringLi
return
true
;
return
true
;
}
}
bool
JsonHelper
::
parseEnum
(
QJsonObject
&
jsonObject
,
QStringList
&
enumStrings
,
QStringList
&
enumValues
,
QString
&
errorString
)
bool
JsonHelper
::
parseEnum
(
const
QJsonObject
&
jsonObject
,
QStringList
&
enumStrings
,
QStringList
&
enumValues
,
QString
&
errorString
)
{
{
enumStrings
=
jsonObject
.
value
(
_enumStringsJsonKey
).
toString
().
split
(
","
,
QString
::
SkipEmptyParts
);
enumStrings
=
jsonObject
.
value
(
_enumStringsJsonKey
).
toString
().
split
(
","
,
QString
::
SkipEmptyParts
);
enumValues
=
jsonObject
.
value
(
_enumValuesJsonKey
).
toString
().
split
(
","
,
QString
::
SkipEmptyParts
);
enumValues
=
jsonObject
.
value
(
_enumValuesJsonKey
).
toString
().
split
(
","
,
QString
::
SkipEmptyParts
);
if
(
enumStrings
.
count
()
!=
enumValues
.
count
())
{
if
(
enumStrings
.
count
()
!=
enumValues
.
count
())
{
errorString
=
QString
(
"enum strings/values count mismatch
: %1"
);
errorString
=
QString
(
"enum strings/values count mismatch
strings:values %1:%2"
).
arg
(
enumStrings
.
count
()).
arg
(
enumValues
.
count
()
);
return
false
;
return
false
;
}
}
...
...
src/JsonHelper.h
View file @
ee22373c
...
@@ -24,7 +24,7 @@ public:
...
@@ -24,7 +24,7 @@ public:
static
bool
validateRequiredKeys
(
const
QJsonObject
&
jsonObject
,
const
QStringList
&
keys
,
QString
&
errorString
);
static
bool
validateRequiredKeys
(
const
QJsonObject
&
jsonObject
,
const
QStringList
&
keys
,
QString
&
errorString
);
static
bool
validateKeyTypes
(
const
QJsonObject
&
jsonObject
,
const
QStringList
&
keys
,
const
QList
<
QJsonValue
::
Type
>&
types
,
QString
&
errorString
);
static
bool
validateKeyTypes
(
const
QJsonObject
&
jsonObject
,
const
QStringList
&
keys
,
const
QList
<
QJsonValue
::
Type
>&
types
,
QString
&
errorString
);
static
bool
toQGeoCoordinate
(
const
QJsonValue
&
jsonValue
,
QGeoCoordinate
&
coordinate
,
bool
altitudeRequired
,
QString
&
errorString
);
static
bool
toQGeoCoordinate
(
const
QJsonValue
&
jsonValue
,
QGeoCoordinate
&
coordinate
,
bool
altitudeRequired
,
QString
&
errorString
);
static
bool
parseEnum
(
QJsonObject
&
jsonObject
,
QStringList
&
enumStrings
,
QStringList
&
enumValues
,
QString
&
errorString
);
static
bool
parseEnum
(
const
QJsonObject
&
jsonObject
,
QStringList
&
enumStrings
,
QStringList
&
enumValues
,
QString
&
errorString
);
static
void
writeQGeoCoordinate
(
QJsonValue
&
jsonValue
,
const
QGeoCoordinate
&
coordinate
,
bool
writeAltitude
);
static
void
writeQGeoCoordinate
(
QJsonValue
&
jsonValue
,
const
QGeoCoordinate
&
coordinate
,
bool
writeAltitude
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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