Open Source Snapmatic picture and Savegame viewer/editor for GTA V https://gta5view.syping.de/

CrewDatabase.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*****************************************************************************
  2. * gta5view Grand Theft Auto V Profile Viewer
  3. * Copyright (C) 2016-2017 Syping
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *****************************************************************************/
  18. #ifndef CREWDATABASE_H
  19. #define CREWDATABASE_H
  20. #include <QSettings>
  21. #include <QObject>
  22. #include <QMutex>
  23. #include <QMap>
  24. class CrewDatabase : public QObject
  25. {
  26. Q_OBJECT
  27. public:
  28. explicit CrewDatabase(QObject *parent = 0);
  29. QString getCrewName(QString crewID);
  30. QString getCrewName(int crewID);
  31. QStringList getCompatibleCrews();
  32. QStringList getCrews();
  33. void setAddingCrews(bool addingCrews);
  34. bool isCompatibleCrew(QString crewNID);
  35. bool isCompatibleCrew(int crewID);
  36. bool isAddingCrews();
  37. ~CrewDatabase();
  38. private:
  39. mutable QMutex mutex;
  40. bool addProcess;
  41. QSettings *crewDB;
  42. QStringList getCrews_p();
  43. QStringList getCompatibleCrews_p();
  44. public slots:
  45. void setCrewName(int crewID, QString crewName);
  46. void addCrew(int crewID);
  47. };
  48. #endif // CREWDATABASE_H