* @brief Moves the currently selected group by one step (direction = -1 up, +1 down). */
| 6571 | * @brief Moves the currently selected group by one step (direction = -1 up, +1 down). |
| 6572 | */ |
| 6573 | bool DataModel::ProjectEditor::moveCurrentGroup(int direction) |
| 6574 | { |
| 6575 | if (m_currentView != GroupView) |
| 6576 | return false; |
| 6577 | |
| 6578 | const int gid = m_selectedGroup.groupId; |
| 6579 | if (gid < 0) |
| 6580 | return false; |
| 6581 | |
| 6582 | const int n = DataModel::ProjectModel::instance().groupCount(); |
| 6583 | const int target = gid + (direction < 0 ? -1 : 1); |
| 6584 | if (target < 0 || target >= n) |
| 6585 | return false; |
| 6586 | |
| 6587 | m_pendingSelectionKind = PendingSelectionKind::Group; |
| 6588 | m_pendingSelectionGroupId = target; |
| 6589 | m_pendingSelectionItemId = -1; |
| 6590 | DataModel::ProjectModel::instance().moveGroup(gid, target); |
| 6591 | return true; |
| 6592 | } |
| 6593 | |
| 6594 | /** |
| 6595 | * @brief Moves the currently selected dataset within its group. |
nothing calls this directly
no test coverage detected