MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / addGroupSubitems

Function addGroupSubitems

lib/macro/macro-tab.cpp:148–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148static void addGroupSubitems(std::vector<std::shared_ptr<Macro>> &macros,
149 const std::shared_ptr<Macro> &group)
150{
151 auto subitems = GetGroupMacroEntries(group.get());
152
153 // Remove subitems which were already selected to avoid duplicates
154 for (const auto &subitem : subitems) {
155 auto it = std::find(macros.begin(), macros.end(), subitem);
156 if (it == macros.end()) {
157 continue;
158 }
159 macros.erase(it);
160 }
161
162 // Add group subitems
163 auto it = std::find(macros.begin(), macros.end(), group);
164 if (it == macros.end()) {
165 return;
166 }
167 it = std::next(it);
168 macros.insert(it, subitems.begin(), subitems.end());
169}
170
171void AdvSceneSwitcher::RemoveMacro(std::shared_ptr<Macro> &macro)
172{

Callers 2

RemoveMacroMethod · 0.85
ExportMacrosMethod · 0.85

Calls 4

GetGroupMacroEntriesFunction · 0.85
getMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected