utils.h 681 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * This file contains minor utility functions
  3. */
  4. #ifndef UTILS_H
  5. #define UTILS_H
  6. #include <QUrl>
  7. #include <QDebug>
  8. #include <QMessageLogContext>
  9. bool checkInternetConnection(QUrl url);
  10. void logMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg);
  11. bool checkSingleAppInstance();
  12. enum AppErrorStatus : int {
  13. E_WRONG_GAME_FOLDER = 16,
  14. E_DAT_FILES_MISSING = 8,
  15. E_WRONG_FILE_PERMISSIONS = 4,
  16. E_DAT_FILE_INCORRECT = 2,
  17. E_NO_SERVER_CONNECTION = 1,
  18. E_NO_ERRORS = 0
  19. };
  20. AppErrorStatus CheckAppPrerequesities();
  21. QDebug operator<<(QDebug dbg, const AppErrorStatus &status);
  22. #endif // UTILS_H