utils.h 718 B

1234567891011121314151617181920212223242526272829303132
  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 = 32,
  14. E_DAT_FILES_MISSING = 16,
  15. E_WRONG_FILE_PERMISSIONS = 8,
  16. E_CANNOT_ACCESS_DAT_FILES = 4,
  17. E_DAT_FILE_INCORRECT = 2,
  18. E_NO_SERVER_CONNECTION = 1,
  19. E_NO_ERRORS = 0
  20. };
  21. AppErrorStatus CheckAppPrerequesities();
  22. QDebug operator<<(QDebug dbg, const AppErrorStatus &status);
  23. #endif // UTILS_H