* @brief Changes the text encoding used by send() and plainTextStr(). */
| 710 | * @brief Changes the text encoding used by send() and plainTextStr(). |
| 711 | */ |
| 712 | void Console::Handler::setEncoding(const int encoding) |
| 713 | { |
| 714 | if (encoding < 0 || encoding > SerialStudio::EncEucKr) |
| 715 | return; |
| 716 | |
| 717 | const auto newEncoding = static_cast<SerialStudio::TextEncoding>(encoding); |
| 718 | if (m_encoding == newEncoding) |
| 719 | return; |
| 720 | |
| 721 | m_encoding = newEncoding; |
| 722 | m_settings.setValue("Console/Encoding", static_cast<int>(m_encoding)); |
| 723 | Q_EMIT encodingChanged(); |
| 724 | } |
| 725 | |
| 726 | //-------------------------------------------------------------------------------------------------- |
| 727 | // Display helpers |
no outgoing calls
no test coverage detected