From 0551e7096761192d6bf2a6ee2868f4d6157e3b5c Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 25 May 2014 17:18:52 -0400 Subject: [PATCH] CmdAppend - Converted from A3 modifications to Task::modify. --- src/commands/CmdAppend.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/commands/CmdAppend.cpp b/src/commands/CmdAppend.cpp index 585e2e238..3fc0e3961 100644 --- a/src/commands/CmdAppend.cpp +++ b/src/commands/CmdAppend.cpp @@ -62,10 +62,7 @@ int CmdAppend::execute (std::string& output) return 1; } - // Apply the command line modifications to the new task. - A3 modifications = context.a3.extract_modifications (); - if (!modifications.size ()) - throw std::string (STRING_CMD_MODIFY_NEED_TEXT); + // TODO Complain when no modifications are specified. // Accumulated project change notifications. std::map projectChanges; @@ -80,7 +77,7 @@ int CmdAppend::execute (std::string& output) task->id, task->get ("description")); - modify_task_description_append (*task, modifications); + task->modify (Task::modAppend); if (permission (*task, taskDifferences (before, *task) + question, filtered.size ())) { @@ -100,7 +97,7 @@ int CmdAppend::execute (std::string& output) std::vector ::iterator sibling; for (sibling = siblings.begin (); sibling != siblings.end (); ++sibling) { - modify_task_description_append (*sibling, modifications); + sibling->modify (Task::modAppend); context.tdb2.modify (*sibling); ++count; feedback_affected (STRING_CMD_APPEND_TASK_R, *sibling); @@ -109,7 +106,7 @@ int CmdAppend::execute (std::string& output) // Append to the parent Task parent; context.tdb2.get (task->get ("parent"), parent); - modify_task_description_append (parent, modifications); + parent.modify (Task::modAppend); context.tdb2.modify (parent); } }