* @brief Loads per-source code into the source engine. */
| 425 | * @brief Loads per-source code into the source engine. |
| 426 | */ |
| 427 | void DataModel::FrameParser::setSourceCode(int sourceId, const QString& code) |
| 428 | { |
| 429 | Q_ASSERT(sourceId >= 0); |
| 430 | Q_ASSERT(m_engines.count(0)); |
| 431 | |
| 432 | if (code.isEmpty()) { |
| 433 | clearSourceEngine(sourceId); |
| 434 | return; |
| 435 | } |
| 436 | |
| 437 | if (!loadScript(sourceId, code, false)) |
| 438 | qWarning() << "[FrameParser] Failed to load script for source" << sourceId; |
| 439 | } |
| 440 | |
| 441 | /** |
| 442 | * @brief Destroys the engine for the source (source 0 is reset in place). |
no test coverage detected