Commit 2767c8ce authored by Volker Krause's avatar Volker Krause
Browse files

Remove legacy aggregation setting generation code

parent ebdf33e6
......@@ -123,24 +123,6 @@ static Product productFromJsonObject(const QJsonObject &obj)
product.setName(obj.value(QStringLiteral("name")).toString());
product.setSchema(SchemaEntry::fromJson(obj.value(QStringLiteral("schema")).toArray()));
product.setAggregations(Aggregation::fromJson(product, obj.value(QLatin1String("aggregation")).toArray()));
// ### temporary HACK
if (product.aggregations().isEmpty()) {
QVector<Aggregation> aggrs;
for (const auto &entry : product.schema()) {
for (const auto &elem : entry.elements()) {
Aggregation aggr;
aggr.setType(Aggregation::Category);
AggregationElement e;
e.setSchemaEntry(entry);
e.setSchemaEntryElement(elem);
aggr.setElements({e});
aggrs.push_back(aggr);
}
}
product.setAggregations(aggrs);
}
return product;
}
......
Supports Markdown
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