- Task now supports a default project and priority for new tasks, via

the new "default.project" and "default.priority" configuration variables
  (thanks to Vincent Fleuranceau).
This commit is contained in:
Paul Beckingham 2008-09-12 12:14:26 -04:00
parent 4380c7c712
commit 4f8f044644
6 changed files with 32 additions and 1 deletions

View file

@ -66,6 +66,20 @@ void handleAdd (const TDB& tdb, T& task, Config& conf)
task.setAttribute ("mask", "");
}
/**/
// Override with default.project, if not specified.
if (task.getAttribute ("project") == "")
task.setAttribute ("project", conf.get ("default.project", ""));
// Override with default.priority, if not specified.
if (task.getAttribute ("priority") == "")
{
std::string defaultPriority = conf.get ("default.priority", "");
if (validPriority (defaultPriority))
task.setAttribute ("priority", defaultPriority);
}
/**/
if (task.getDescription () == "")
throw std::string ("Cannot add a blank task.");