* @brief Applies @p enabled to every group whose folder is @p folderId or nested beneath it, so a * folder toggle cascades to its whole subtree. Returns true when a group actually changed. */
| 8225 | * folder toggle cascades to its whole subtree. Returns true when a group actually changed. |
| 8226 | */ |
| 8227 | bool DataModel::ProjectModel::setGroupsInFolderEnabled(const int folderId, const bool enabled) |
| 8228 | { |
| 8229 | bool changed = false; |
| 8230 | for (auto& g : m_groups) { |
| 8231 | if (g.parentFolderId == -1) |
| 8232 | continue; |
| 8233 | |
| 8234 | if (!folderIsSelfOrDescendant(m_groupFolders, folderId, g.parentFolderId)) |
| 8235 | continue; |
| 8236 | |
| 8237 | if (g.enabled == enabled) |
| 8238 | continue; |
| 8239 | |
| 8240 | g.enabled = enabled; |
| 8241 | changed = true; |
| 8242 | } |
| 8243 | |
| 8244 | return changed; |
| 8245 | } |
| 8246 | |
| 8247 | /** |
| 8248 | * @brief Enables or disables every applicable item in a tree multi-selection in one pass; a group |
nothing calls this directly
no test coverage detected