MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / closeFile

Method closeFile

app/src/IO/FileTransmission.cpp:306–324  ·  view source on GitHub ↗

* @brief Closes the currently selected file and resets state. */

Source from the content-addressed store, hash-verified

304 * @brief Closes the currently selected file and resets state.
305 */
306void 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

Callers

nothing calls this directly

Calls 3

isOpenMethod · 0.45
closeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected