| 66 | #endif |
| 67 | |
| 68 | bool initCrashHandler(const char* exePath) { |
| 69 | #ifndef NO_CRASH_HANDLER |
| 70 | QFile crashDmp(STACKTRACE_LOG); |
| 71 | |
| 72 | bool lastSessionCrashed = false; |
| 73 | if(crashDmp.exists() && crashDmp.open(QFile::ReadOnly | QFile::Text)) |
| 74 | { |
| 75 | QTextStream in(&crashDmp); |
| 76 | auto lastDmp = in.readAll(); |
| 77 | crashDmp.close(); |
| 78 | |
| 79 | if(lastDmp.length() > 10) |
| 80 | { |
| 81 | lastSessionCrashed = true; |
| 82 | crashDmp.copy(STACKTRACE_LOG_OLD); |
| 83 | Log::backupLastLog(); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | EXECUTION_FILENAME = exePath; |
| 88 | airbag_init_fd(safe_open_wo_fd("/tmp/jamesdsp/crash.dmp"), onExceptionRaised, EXECUTION_FILENAME); |
| 89 | return lastSessionCrashed; |
| 90 | #else |
| 91 | return false; |
| 92 | #endif |
| 93 | } |
| 94 | |
| 95 | #ifndef HEADLESS |
| 96 | void initTranslator(const QLocale& locale) { |
no test coverage detected