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

Method deleteGroup

app/src/DataModel/ProjectModel.cpp:7877–7894  ·  view source on GitHub ↗

* @brief Deletes the group at @p groupId; opt-in confirmation reuses deleteCurrentGroup's dialog. */

Source from the content-addressed store, hash-verified

7875 * @brief Deletes the group at @p groupId; opt-in confirmation reuses deleteCurrentGroup's dialog.
7876 */
7877void DataModel::ProjectModel::deleteGroup(int groupId, bool confirm)
7878{
7879 if (groupId < 0 || static_cast<size_t>(groupId) >= m_groups.size())
7880 return;
7881
7882 const auto previousSelection = m_selectedGroup;
7883 setSelectedGroup(m_groups[groupId]);
7884
7885 const bool previousSuppress = m_suppressMessageBoxes;
7886 m_suppressMessageBoxes = !confirm;
7887 deleteCurrentGroup();
7888 m_suppressMessageBoxes = previousSuppress;
7889
7890 if (previousSelection.groupId >= 0
7891 && static_cast<size_t>(previousSelection.groupId) < m_groups.size()
7892 && previousSelection.groupId != groupId)
7893 setSelectedGroup(m_groups[previousSelection.groupId]);
7894}
7895
7896/**
7897 * @brief Duplicates the group at @p groupId via the existing selection-based path.

Callers 1

groupDeleteMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected