MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / modifyRecurrenceSiblings

Method modifyRecurrenceSiblings

src/commands/CmdModify.cpp:152–180  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

150
151////////////////////////////////////////////////////////////////////////////////
152int CmdModify::modifyRecurrenceSiblings(
153 Task& task, std::map<std::string, std::string>* projectChanges /* = NULL */) {
154 auto count = 0;
155
156 if ((Context::getContext().config.get("recurrence.confirmation") == "prompt" &&
157 confirm(STRING_CMD_MODIFY_RECUR)) ||
158 Context::getContext().config.getBoolean("recurrence.confirmation")) {
159 std::vector<Task> siblings = Context::getContext().tdb2.siblings(task);
160 for (auto& sibling : siblings) {
161 Task alternate(sibling);
162 sibling.modify(Task::modReplace);
163 updateRecurrenceMask(sibling);
164 ++count;
165 feedback_affected(STRING_CMD_MODIFY_TASK_R, sibling);
166 feedback_unblocked(sibling);
167 Context::getContext().tdb2.modify(sibling);
168 if (Context::getContext().verbose("project") && projectChanges)
169 (*projectChanges)[sibling.get("project")] = onProjectChange(alternate, sibling);
170 }
171
172 // Modify the parent
173 Task parent;
174 Context::getContext().tdb2.get(task.get("parent"), parent);
175 parent.modify(Task::modReplace);
176 Context::getContext().tdb2.modify(parent);
177 }
178
179 return count;
180}
181
182////////////////////////////////////////////////////////////////////////////////
183int CmdModify::modifyRecurrenceParent(

Callers

nothing calls this directly

Calls 8

updateRecurrenceMaskFunction · 0.85
feedback_affectedFunction · 0.85
feedback_unblockedFunction · 0.85
onProjectChangeFunction · 0.85
siblingsMethod · 0.80
verboseMethod · 0.80
getMethod · 0.45
modifyMethod · 0.45

Tested by

no test coverage detected