Commit 3cc7e1f9 authored by Volker Krause's avatar Volker Krause
Browse files

Clean up leftovers from the old singular deserialization API

parent 34bded7f
......@@ -244,7 +244,17 @@ static QVariant createInstance(const QJsonObject &obj)
}
#undef MAKE_FACTORY
static QVector<QVariant> fromJson(const QJsonObject &obj) // TODO this should replace JsonLdDocument::fromJson once we can change the API
QVector<QVariant> JsonLdDocument::fromJson(const QJsonArray &array)
{
QVector<QVariant> l;
l.reserve(array.size());
for (const auto &obj : array) {
l.append(JsonLdDocument::fromJson(obj.toObject()));
}
return l;
}
QVector<QVariant> JsonLdDocument::fromJson(const QJsonObject &obj)
{
const auto normalized = JsonLdImportFilter::filterObject(obj);
QVector<QVariant> result;
......@@ -258,21 +268,6 @@ static QVector<QVariant> fromJson(const QJsonObject &obj) // TODO this should re
return result;
}
QVector<QVariant> JsonLdDocument::fromJson(const QJsonArray &array)
{
QVector<QVariant> l;
l.reserve(array.size());
for (const auto &obj : array) {
l.append(::fromJson(obj.toObject()));
}
return l;
}
QVariant JsonLdDocument::fromJson(const QJsonObject& obj)
{
return fromJsonSingular(obj); // ### temporary, see above
}
QVariant JsonLdDocument::fromJsonSingular(const QJsonObject &obj)
{
const auto normalized = JsonLdImportFilter::filterObject(obj);
......
......@@ -26,7 +26,7 @@ public:
/** Convert JSON-LD array into instantiated data types. */
static KITINERARY_EXPORT QVector<QVariant> fromJson(const QJsonArray &array);
/** Convert JSON-LD object into an instantiated data type. */
static KITINERARY_EXPORT QVariant fromJson(const QJsonObject &obj); // TODO return QVector<QVariant> here
static KITINERARY_EXPORT QVector<QVariant> fromJson(const QJsonObject &obj);
/** Convert a single JSON-LD object into an instantiated data type.
* @note Use this only if you are sure the JSON-LD object does not expand to multiple objects!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment