mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
refs #650 Implement CAirportDataReader
* Add BlackCore::CAirportDataReader class * Add cache traits for airport list * Add corresponding WebReaderFlag * Add CAirport::convertFromDatabaseJson() * Add CApplication::headerFromNetwork() to handle HTTP HEAD method
This commit is contained in:
@@ -44,5 +44,19 @@ namespace BlackMisc
|
||||
return this->findFirstByOrDefault(&CAirport::getIcao, icao, ifNotFound);
|
||||
}
|
||||
|
||||
CAirportList CAirportList::fromDatabaseJson(const QJsonArray &json)
|
||||
{
|
||||
CAirportList airports;
|
||||
for (const QJsonValue& value: json)
|
||||
{
|
||||
QJsonObject object = value.toObject();
|
||||
CAirport airport;
|
||||
airport.fromDatabaseJson(object);
|
||||
airports.push_back(airport);
|
||||
}
|
||||
|
||||
return airports;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user