Bug 449 - Inconsistent wait: attribute results

- Fixed bug #449, so the wait: attribute can be applied to a task at any
  time, not just on add.
- While searching for problems with the waiting status, noticed that
  importCSV doesn't appear to set any tasks to pending status.
This commit is contained in:
Paul Beckingham 2010-07-28 23:22:59 -04:00
parent 4d266412ee
commit 2ef30b1183
4 changed files with 30 additions and 6 deletions

View file

@ -69,8 +69,12 @@ int handleAdd (std::string &outs)
context.task.setStatus (Task::recurring);
context.task.set ("mask", "");
}
// Tasks with a wait: date get a special status.
else if (context.task.has ("wait"))
context.task.setStatus (Task::waiting);
// By default, tasks are pending.
else
context.task.setStatus (Task::pending);
@ -1335,7 +1339,8 @@ int handleDone (std::string &outs)
bool nagged = false;
foreach (task, tasks)
{
if ((task->getStatus () == Task::pending) || (task->getStatus () == Task::waiting))
if (task->getStatus () == Task::pending ||
task->getStatus () == Task::waiting)
{
Task before (*task);
@ -2298,9 +2303,15 @@ int deltaAttributes (Task& task)
if (att->second.name () == "wait")
{
if (att->second.value () == "")
{
task.remove (att->first);
task.setStatus (Task::pending);
}
else
{
task.set (att->first, att->second.value ());
task.setStatus (Task::waiting);
}
}
// Modifying dependencies requires adding/removing uuids.