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

Method readCode

app/src/DataModel/Editors/PainterCodeEditor.cpp:326–344  ·  view source on GitHub ↗

* @brief Loads the painter code from the currently selected group. */

Source from the content-addressed store, hash-verified

324 * @brief Loads the painter code from the currently selected group.
325 */
326void DataModel::PainterCodeEditor::readCode()
327{
328 if (m_readingCode)
329 return;
330
331 m_readingCode = true;
332
333 auto& editor = DataModel::ProjectEditor::instance();
334 QString code = editor.currentGroupPainterCode();
335 if (code.isEmpty())
336 code = defaultTemplate();
337
338 m_widget.setPlainText(code);
339 m_widget.document()->clearUndoRedoStacks();
340 m_widget.document()->setModified(false);
341
342 m_readingCode = false;
343 Q_EMIT modifiedChanged();
344}
345
346/**
347 * @brief Reads the painter template manifest and returns the `datasets` array

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
setModifiedMethod · 0.80

Tested by

no test coverage detected