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

Method templateIndex

app/src/DataModel/Editors/FrameParserModel.cpp:130–139  ·  view source on GitHub ↗

* @brief Returns the registry index of the source's template (default template if unset). */

Source from the content-addressed store, hash-verified

128 * @brief Returns the registry index of the source's template (default template if unset).
129 */
130int DataModel::FrameParserModel::templateIndex() const
131{
132 const QString id = ProjectModel::instance().frameParserTemplate(m_sourceId);
133 const auto& templates = nativeTemplates();
134 for (int i = 0; i < templates.size(); ++i)
135 if (templates.at(i)->id() == id)
136 return i;
137
138 return 0;
139}
140
141/**
142 * @brief Returns the current parameter validation error, or an empty string.

Callers

nothing calls this directly

Calls 3

frameParserTemplateMethod · 0.80
sizeMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected