mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
- 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:
parent
4380c7c712
commit
4f8f044644
6 changed files with 32 additions and 1 deletions
|
@ -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.");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue