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

Method deleteAction

app/src/DataModel/ProjectModel.cpp:7967–7984  ·  view source on GitHub ↗

* @brief Deletes the action at @p actionId via the existing selection-based path. */

Source from the content-addressed store, hash-verified

7965 * @brief Deletes the action at @p actionId via the existing selection-based path.
7966 */
7967void DataModel::ProjectModel::deleteAction(int actionId, bool confirm)
7968{
7969 if (actionId < 0 || static_cast<size_t>(actionId) >= m_actions.size())
7970 return;
7971
7972 const auto previousSelection = m_selectedAction;
7973 setSelectedAction(m_actions[actionId]);
7974
7975 const bool previousSuppress = m_suppressMessageBoxes;
7976 m_suppressMessageBoxes = !confirm;
7977 deleteCurrentAction();
7978 m_suppressMessageBoxes = previousSuppress;
7979
7980 if (previousSelection.actionId >= 0
7981 && static_cast<size_t>(previousSelection.actionId) < m_actions.size()
7982 && previousSelection.actionId != actionId)
7983 setSelectedAction(m_actions[previousSelection.actionId]);
7984}
7985
7986/**
7987 * @brief Duplicates the action at @p actionId.

Callers 1

actionDeleteMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected