* @brief Closes the currently selected file and resets state. */
| 304 | * @brief Closes the currently selected file and resets state. |
| 305 | */ |
| 306 | void IO::FileTransmission::closeFile() |
| 307 | { |
| 308 | stopTransmission(); |
| 309 | |
| 310 | if (m_file.isOpen()) |
| 311 | m_file.close(); |
| 312 | |
| 313 | if (m_stream) { |
| 314 | delete m_stream; |
| 315 | m_stream = nullptr; |
| 316 | } |
| 317 | |
| 318 | m_bytesSent = 0; |
| 319 | m_bytesTotal = 0; |
| 320 | m_filePath.clear(); |
| 321 | |
| 322 | Q_EMIT fileChanged(); |
| 323 | Q_EMIT progressChanged(); |
| 324 | } |
| 325 | |
| 326 | //-------------------------------------------------------------------------------------------------- |
| 327 | // Transmission control |