Commit c1d32254 authored by Laurent Montel's avatar Laurent Montel 😁

Coding style

parent 94437d7a
......@@ -144,8 +144,8 @@ bool ExtractorPostprocessor::filterFlight(const QVariant &flight) const
const auto depDt = JsonLdDocument::readProperty(flight, "departureTime").toDateTime();
const auto arrDt = JsonLdDocument::readProperty(flight, "arrivalTime").toDateTime();
return filterAirport(JsonLdDocument::readProperty(flight, "departureAirport"))
&& filterAirport(JsonLdDocument::readProperty(flight, "arrivalAirport"))
&& depDt.isValid() && arrDt.isValid();
&& filterAirport(JsonLdDocument::readProperty(flight, "arrivalAirport"))
&& depDt.isValid() && arrDt.isValid();
}
bool ExtractorPostprocessor::filterAirport(const QVariant &airport) const
......
......@@ -119,17 +119,17 @@ static QJsonValue toJson(const QVariant &v)
const auto mo = QMetaType(v.userType()).metaObject();
if (!mo) {
// basic types
switch (v.type()) {
case QVariant::String:
return v.toString();
case QVariant::Double:
return v.toDouble();
case QVariant::Int:
return v.toInt();
case QVariant::DateTime:
return v.toDateTime().toString(Qt::ISODate);
default:
break;
switch (v.type()) {
case QVariant::String:
return v.toString();
case QVariant::Double:
return v.toDouble();
case QVariant::Int:
return v.toInt();
case QVariant::DateTime:
return v.toDateTime().toString(Qt::ISODate);
default:
break;
}
if (v.userType() == qMetaTypeId<float>()) {
return v.toFloat();
......
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