MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / setGroupsInFolderEnabled

Method setGroupsInFolderEnabled

app/src/DataModel/ProjectModel.cpp:8227–8245  ·  view source on GitHub ↗

* @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. */

Source from the content-addressed store, hash-verified

8225 * folder toggle cascades to its whole subtree. Returns true when a group actually changed.
8226 */
8227bool 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

Callers

nothing calls this directly

Calls 1

folderIsSelfOrDescendantFunction · 0.85

Tested by

no test coverage detected