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

Method applyGroupSourceEdit

app/src/DataModel/ProjectEditor.cpp:4217–4228  ·  view source on GitHub ↗

* @brief Re-routes the group (and its datasets) to the source at the given combobox index. */

Source from the content-addressed store, hash-verified

4215 * @brief Re-routes the group (and its datasets) to the source at the given combobox index.
4216 */
4217void DataModel::ProjectEditor::applyGroupSourceEdit(int srcIdx, int groupId)
4218{
4219 const auto& sources = DataModel::ProjectModel::instance().sources();
4220 if (srcIdx < 0 || srcIdx >= static_cast<int>(sources.size()))
4221 return;
4222
4223 m_selectedGroup.sourceId = sources[srcIdx].sourceId;
4224 for (auto& ds : m_selectedGroup.datasets)
4225 ds.sourceId = m_selectedGroup.sourceId;
4226
4227 DataModel::ProjectModel::instance().updateGroup(groupId, m_selectedGroup, true);
4228}
4229
4230/**
4231 * @brief Applies a group-widget change; returns false when the change is rejected.

Callers

nothing calls this directly

Calls 2

updateGroupMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected