mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Task: Recurring tasks get rtype:periodic by default
This commit is contained in:
parent
4a5dfad74d
commit
7b6e24a164
1 changed files with 14 additions and 4 deletions
18
src/Task.cpp
18
src/Task.cpp
|
@ -1506,12 +1506,16 @@ void Task::validate (bool applyDefault /* = true */)
|
|||
else
|
||||
set ("uuid", uuid ());
|
||||
|
||||
// TODO Obsolete remove for 2.6.0
|
||||
// Recurring tasks get a special status.
|
||||
if (status == Task::pending &&
|
||||
has ("due") &&
|
||||
has ("recur") &&
|
||||
(! has ("parent") || get ("parent") == ""))
|
||||
if (status == Task::pending &&
|
||||
has ("due") &&
|
||||
has ("recur") &&
|
||||
(! has ("parent") || get ("parent") == "") &&
|
||||
(! has ("tenplate") || get ("tenplate") == ""))
|
||||
{
|
||||
status = Task::recurring;
|
||||
}
|
||||
|
||||
// Tasks with a wait: date get a special status.
|
||||
else if (status == Task::pending &&
|
||||
|
@ -1523,6 +1527,12 @@ void Task::validate (bool applyDefault /* = true */)
|
|||
else if (! has ("status") || get ("status") == "")
|
||||
status = Task::pending;
|
||||
|
||||
if (status == Task::recurring &&
|
||||
(! has ("rtype") || get ("rtype") == ""))
|
||||
{
|
||||
set ("rtype", "periodic");
|
||||
}
|
||||
|
||||
// Store the derived status.
|
||||
setStatus (status);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue