12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- #ifndef DBCOMPLETIONDATA_H
- #define DBCOMPLETIONDATA_H
- #include "src/opl.h"
- namespace OPL {
- enum class CompleterTarget
- {
- AirportIdentifierICAO,
- AirportIdentifierIATA,
- AirportIdentifier,
- AirportNames,
- Registrations,
- Companies,
- PilotNames,
- AircraftTypes
- };
- class DbCompletionData
- {
- public:
-
- void init();
-
- void update();
- void updateTails();
- void updatePilots();
- void updateAirports();
-
- QHash<int, QString> pilotsIdMap;
- QHash<int, QString> tailsIdMap;
- QHash<int, QString> airportIcaoIdMap;
- QHash<int, QString> airportIataIdMap;
- QHash<int, QString> airportNameIdMap;
-
- QStringList pilotList;
- QStringList tailsList;
- QStringList airportList;
-
- static const QStringList getCompletionList(CompleterTarget target);
-
- static const QHash<int, QString> getIdMap(CompleterTarget target);
- const QHash<int, QString> &getAirportsMapICAO() const;
- const QHash<int, QString> &getAirportsMapIATA() const;
- private:
- QHash<int, QString> airportsMapICAO;
- QHash<int, QString> airportsMapIATA;
- };
- }
- #endif // DBCOMPLETIONDATA_H
|