* Write the (crash) screenshot to a file. * @note The filename will be written to \c screenshot_filename. * @return std::nullopt when the crash screenshot could not be made, otherwise the filename. */
| 244 | * @return std::nullopt when the crash screenshot could not be made, otherwise the filename. |
| 245 | */ |
| 246 | bool CrashLog::WriteScreenshot() |
| 247 | { |
| 248 | /* Don't draw when we have invalid screen size */ |
| 249 | if (_screen.width < 1 || _screen.height < 1 || _screen.dst_ptr == nullptr) return false; |
| 250 | |
| 251 | std::string filename = this->CreateFileName("", false); |
| 252 | bool res = MakeScreenshot(SC_CRASHLOG, std::move(filename)); |
| 253 | if (res) this->screenshot_filename = _full_screenshot_path; |
| 254 | return res; |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * Send the survey result, noting it was a crash. |
no test coverage detected