* @brief Re-parents a group folder, rejecting a cyclic move into its own subtree. */
| 6425 | * @brief Re-parents a group folder, rejecting a cyclic move into its own subtree. |
| 6426 | */ |
| 6427 | void DataModel::ProjectModel::moveGroupFolderToFolder(int folderId, int parentFolderId) |
| 6428 | { |
| 6429 | if (parentFolderId != -1 && !folderExists(m_groupFolders, parentFolderId)) |
| 6430 | return; |
| 6431 | |
| 6432 | if (folderIsSelfOrDescendant(m_groupFolders, folderId, parentFolderId)) |
| 6433 | return; |
| 6434 | |
| 6435 | for (auto& f : m_groupFolders) { |
| 6436 | if (f.folderId != folderId) |
| 6437 | continue; |
| 6438 | |
| 6439 | if (f.parentFolderId == parentFolderId) |
| 6440 | return; |
| 6441 | |
| 6442 | f.parentFolderId = parentFolderId; |
| 6443 | setModified(true); |
| 6444 | Q_EMIT groupsChanged(); |
| 6445 | return; |
| 6446 | } |
| 6447 | } |
| 6448 | |
| 6449 | /** |
| 6450 | * @brief Reorders a group folder among its sibling folders in the same parent. |
nothing calls this directly
no test coverage detected