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

Method setSourceCode

app/src/DataModel/Scripting/FrameParser.cpp:427–439  ·  view source on GitHub ↗

* @brief Loads per-source code into the source engine. */

Source from the content-addressed store, hash-verified

425 * @brief Loads per-source code into the source engine.
426 */
427void 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).

Callers 1

Calls 2

isEmptyMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected