2
0

acompletiondata.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef ACOMPLETIONDATA_H
  2. #define ACOMPLETIONDATA_H
  3. #include "src/database/database.h"
  4. /*!
  5. * \brief The ACompletionData class provides data to QCompleters and QHashs used
  6. * for mapping user input to database keys. It retreives the completer targets
  7. * and mapping data from the database and caches it for fast access without the
  8. * need to query the database.
  9. */
  10. class ACompletionData
  11. {
  12. public:
  13. /*!
  14. * \brief init Retrieves Data and populates Lists and Maps
  15. */
  16. void init();
  17. /*!
  18. * \brief updates data from the user modifiable tables
  19. */
  20. void update();
  21. void updateTails();
  22. void updatePilots();
  23. // Maps for input mapping DB key - user input
  24. QHash<int, QString> pilotsIdMap;
  25. QHash<int, QString> tailsIdMap;
  26. QHash<int, QString> airportIcaoIdMap;
  27. QHash<int, QString> airportIataIdMap;
  28. QHash<int, QString> airportNameIdMap;
  29. // Lists for QCompleter
  30. QStringList pilotList;
  31. QStringList tailsList;
  32. QStringList airportList;
  33. // User Data State to trigger update if needed
  34. UserDataState current_state;
  35. };
  36. #endif // ACOMPLETIONDATA_H