mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-31 17:42:55 +08:00
Update FrameInfo.cpp
This commit is contained in:
parent
4d5eac980e
commit
f805fcfae0
@ -77,7 +77,10 @@ JFI_Object JFI_CreateNew(const quint64 n, const QDateTime &t, const QJsonDocumen
|
||||
*/
|
||||
QJsonValue JFI_Value(const QJsonObject &object, const QString key)
|
||||
{
|
||||
return JFI_Value(object, StringList { key });
|
||||
if (object.contains(key))
|
||||
return object.value(key);
|
||||
|
||||
return QJsonValue();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,11 +88,10 @@ QJsonValue JFI_Value(const QJsonObject &object, const QString key)
|
||||
*/
|
||||
QJsonValue JFI_Value(const QJsonObject &object, const StringList keys)
|
||||
{
|
||||
for (int i = 0; i < keys.count(); ++i)
|
||||
foreach (auto key, keys)
|
||||
{
|
||||
auto tag = keys.at(i);
|
||||
if (object.contains(tag))
|
||||
return object.value(tag);
|
||||
if (object.contains(key))
|
||||
return object.value(key);
|
||||
}
|
||||
|
||||
return QJsonValue();
|
||||
|
Loading…
x
Reference in New Issue
Block a user