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

Method setTransferMode

app/src/IO/FileTransmission.cpp:515–541  ·  view source on GitHub ↗

* @brief Sets the transfer mode. */

Source from the content-addressed store, hash-verified

513 * @brief Sets the transfer mode.
514 */
515void IO::FileTransmission::setTransferMode(int mode)
516{
517 auto newMode = static_cast<TransferMode>(qBound(0, mode, 5));
518 if (m_transferMode != newMode) {
519 if (active())
520 stopTransmission();
521
522 m_transferMode = newMode;
523
524 if (m_file.isOpen()) {
525 m_file.seek(0);
526 m_bytesSent = 0;
527
528 if (m_stream) {
529 delete m_stream;
530 m_stream = nullptr;
531 }
532
533 if (m_transferMode == PlainText)
534 m_stream = new QTextStream(&m_file);
535 }
536
537 Q_EMIT progressChanged();
538
539 Q_EMIT transferModeChanged();
540 }
541}
542
543/**
544 * @brief Sets the protocol timeout in milliseconds.

Callers

nothing calls this directly

Calls 1

isOpenMethod · 0.45

Tested by

no test coverage detected