* @brief Files a group into folder @p parentFolderId (-1 = top level); never reorders m_groups. */
| 6405 | * @brief Files a group into folder @p parentFolderId (-1 = top level); never reorders m_groups. |
| 6406 | */ |
| 6407 | void DataModel::ProjectModel::moveGroupToFolder(int groupId, int parentFolderId) |
| 6408 | { |
| 6409 | if (parentFolderId != -1 && !folderExists(m_groupFolders, parentFolderId)) |
| 6410 | return; |
| 6411 | |
| 6412 | if (groupId < 0 || static_cast<size_t>(groupId) >= m_groups.size()) |
| 6413 | return; |
| 6414 | |
| 6415 | auto& group = m_groups[static_cast<size_t>(groupId)]; |
| 6416 | if (group.parentFolderId == parentFolderId) |
| 6417 | return; |
| 6418 | |
| 6419 | group.parentFolderId = parentFolderId; |
| 6420 | setModified(true); |
| 6421 | Q_EMIT groupsChanged(); |
| 6422 | } |
| 6423 | |
| 6424 | /** |
| 6425 | * @brief Re-parents a group folder, rejecting a cyclic move into its own subtree. |
nothing calls this directly
no test coverage detected