Code Cleanup

- Replaced multiple Task:setX methods with Task::setAsNow (x).
This commit is contained in:
Paul Beckingham 2014-09-14 11:57:02 -04:00
parent cf5dbbb9ee
commit b5f3cfd9a3
6 changed files with 15 additions and 47 deletions

View file

@ -87,7 +87,7 @@ int CmdDelete::execute (std::string& output)
task->modify (Task::modAnnotate);
task->setStatus (Task::deleted);
if (! task->has ("end"))
task->setEnd ();
task->setAsNow ("end");
if (permission (*task, question, filtered.size ()))
{
@ -112,7 +112,7 @@ int CmdDelete::execute (std::string& output)
sibling->modify (Task::modAnnotate);
sibling->setStatus (Task::deleted);
if (! sibling->has ("end"))
sibling->setEnd ();
sibling->setAsNow ("end");
updateRecurrenceMask (*sibling);
context.tdb2.modify (*sibling);
@ -126,7 +126,7 @@ int CmdDelete::execute (std::string& output)
context.tdb2.get (task->get ("parent"), parent);
parent.setStatus (Task::deleted);
if (! parent.has ("end"))
parent.setEnd ();
parent.setAsNow ("end");
context.tdb2.modify (parent);
}
@ -145,7 +145,7 @@ int CmdDelete::execute (std::string& output)
child->modify (Task::modAnnotate);
child->setStatus (Task::deleted);
if (! child->has ("end"))
child->setEnd ();
child->setAsNow ("end");
updateRecurrenceMask (*child);
context.tdb2.modify (*child);

View file

@ -82,7 +82,7 @@ int CmdDone::execute (std::string& output)
task->modify (Task::modAnnotate);
task->setStatus (Task::completed);
if (! task->has ("end"))
task->setEnd ();
task->setAsNow ("end");
// Stop the task, if started.
if (task->has ("start"))

View file

@ -78,7 +78,7 @@ int CmdStart::execute (std::string& output)
task->id,
task->get ("description"));
task->modify (Task::modAnnotate);
task->setStart ();
task->setAsNow ("start");
if (context.config.getBoolean ("journal.time"))
task->addAnnotation (context.config.get ("journal.time.start.annotation"));