From 7b6e24a1649a0153dd77216679ccecd4783c4186 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 28 Feb 2017 00:11:58 -0500 Subject: [PATCH] Task: Recurring tasks get rtype:periodic by default --- src/Task.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Task.cpp b/src/Task.cpp index b2813d427..4a301d743 100644 --- a/src/Task.cpp +++ b/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);