* @brief Closes all per-device output files. */
| 93 | * @brief Closes all per-device output files. |
| 94 | */ |
| 95 | void Console::ExportWorker::closeResources() |
| 96 | { |
| 97 | bool wasOpen = isResourceOpen(); |
| 98 | for (auto& [id, state] : m_deviceFiles) { |
| 99 | if (state.file && state.file->isOpen()) { |
| 100 | state.stream.reset(); |
| 101 | state.file->close(); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | m_deviceFiles.clear(); |
| 106 | |
| 107 | if (wasOpen) |
| 108 | Q_EMIT resourceOpenChanged(); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * @brief Creates a new console log file for the given device. |