* @brief Updates the control-script source; restarts the worker if connected. */
| 188 | * @brief Updates the control-script source; restarts the worker if connected. |
| 189 | */ |
| 190 | void DataModel::ControlScript::setCode(const QString& code) |
| 191 | { |
| 192 | if (m_code == code) |
| 193 | return; |
| 194 | |
| 195 | m_code = code; |
| 196 | Q_EMIT codeChanged(); |
| 197 | |
| 198 | if (shouldRun()) { |
| 199 | stopWorker(); |
| 200 | startWorker(); |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * @brief Runs the script's optional onConnect() hook synchronously BEFORE the connection opens, |
no outgoing calls
no test coverage detected