fix for object below array in JSONBreakableMarshal

This commit is contained in:
Stephen Birarda 2015-05-04 16:32:26 -07:00
parent 8890c40e15
commit ff89831894
2 changed files with 3 additions and 3 deletions

View file

@ -274,7 +274,7 @@ QJsonObject AudioMixerClientData::getAudioStreamStats() const {
injectorArray.push_back(upstreamStats);
}
}
result["injectors"] = injectorArray;
return result;

View file

@ -185,7 +185,7 @@ QVariantMap JSONBreakableMarshal::fromStringList(const QStringList& stringList)
// check if we need to resize the array
if (currentList.size() < arrayIndex + 1) {
for (int i = currentList.size() - 1; i < arrayIndex + 1; i++) {
for (int i = currentList.size(); i < arrayIndex + 1; i++) {
// add the null QJsonValue at this array index to get the array to the right size
currentList.push_back(QJsonValue());
}
@ -221,7 +221,7 @@ QVariantMap JSONBreakableMarshal::fromStringList(const QStringList& stringList)
nextBreakIndex = keySeparatorIndex;
nextKeypathStartIndex = keySeparatorIndex + 1;
} else if (keySeparatorIndex == -1 || (arrayBracketIndex != -1
&& keySeparatorIndex < arrayBracketIndex)) {
&& arrayBracketIndex < keySeparatorIndex)) {
nextBreakIndex = arrayBracketIndex;
nextKeypathStartIndex = arrayBracketIndex;
} else {