utils: Assume that the top object in svg cursor metadata is an array
This adapts the svg cursor loading code to the recent metadata format changes.
This commit is contained in:
parent
95611189d5
commit
5cff8cd2d1
1 changed files with 1 additions and 7 deletions
|
@ -74,13 +74,7 @@ std::optional<SvgCursorMetaData> SvgCursorMetaData::parse(const QString &filePat
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<SvgCursorMetaDataEntry> entries;
|
QList<SvgCursorMetaDataEntry> entries;
|
||||||
if (document.isObject()) {
|
if (document.isArray()) {
|
||||||
if (const auto entry = SvgCursorMetaDataEntry::parse(document.object())) {
|
|
||||||
entries.append(entry.value());
|
|
||||||
} else {
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
} else if (document.isArray()) {
|
|
||||||
const QJsonArray array = document.array();
|
const QJsonArray array = document.array();
|
||||||
for (int i = 0; i < array.size(); ++i) {
|
for (int i = 0; i < array.size(); ++i) {
|
||||||
const QJsonValue element = array.at(i);
|
const QJsonValue element = array.at(i);
|
||||||
|
|
Loading…
Reference in a new issue