* @brief Moves the currently selected action up or down in the actions list. */
| 6624 | * @brief Moves the currently selected action up or down in the actions list. |
| 6625 | */ |
| 6626 | bool DataModel::ProjectEditor::moveCurrentAction(int direction) |
| 6627 | { |
| 6628 | if (m_currentView != ActionView) |
| 6629 | return false; |
| 6630 | |
| 6631 | const int aid = m_selectedAction.actionId; |
| 6632 | if (aid < 0) |
| 6633 | return false; |
| 6634 | |
| 6635 | const int n = static_cast<int>(DataModel::ProjectModel::instance().actions().size()); |
| 6636 | const int target = aid + (direction < 0 ? -1 : 1); |
| 6637 | if (target < 0 || target >= n) |
| 6638 | return false; |
| 6639 | |
| 6640 | DataModel::ProjectModel::instance().moveAction(aid, target); |
| 6641 | return true; |
| 6642 | } |
| 6643 | |
| 6644 | /** |
| 6645 | * @brief Moves the currently selected output widget within its group. |
nothing calls this directly
no test coverage detected