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

Method applyGroupTitleEdit

app/src/DataModel/ProjectEditor.cpp:4191–4212  ·  view source on GitHub ↗

* @brief Applies a group-title edit; returns false when the title is unchanged. */

Source from the content-addressed store, hash-verified

4189 * @brief Applies a group-title edit; returns false when the title is unchanged.
4190 */
4191bool DataModel::ProjectEditor::applyGroupTitleEdit(const QString& newTitle, int groupId)
4192{
4193 if (m_selectedGroup.title == newTitle)
4194 return false;
4195
4196 m_selectedGroup.title = newTitle;
4197 DataModel::ProjectModel::instance().updateGroup(groupId, m_selectedGroup, false);
4198
4199 for (auto it = m_groupItems.begin(); it != m_groupItems.end(); ++it) {
4200 if (it.value().groupId != groupId)
4201 continue;
4202
4203 auto* treeItem = it.key();
4204 treeItem->setText(newTitle);
4205 treeItem->setData(newTitle, TreeViewText);
4206 m_groupItems[treeItem].title = newTitle;
4207 break;
4208 }
4209
4210 Q_EMIT selectedTextChanged();
4211 return true;
4212}
4213
4214/**
4215 * @brief Re-routes the group (and its datasets) to the source at the given combobox index.

Callers

nothing calls this directly

Calls 4

updateGroupMethod · 0.80
beginMethod · 0.80
keyMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected