From 4287b337962a5e3e336f8837c0c60ba0a79d5099 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 16 Oct 2021 11:11:15 -0400 Subject: [PATCH] Task: Only consider pending tasks as waiting --- src/Task.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Task.cpp b/src/Task.cpp index ef4ada05e..8c7c6ffdb 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -578,12 +578,14 @@ bool Task::is_overdue () const #endif //////////////////////////////////////////////////////////////////////////////// +// Task is considered waiting if it's pending and the wait attribute is set as +// future datetime value. +// While this is not consistent with other attribute-based virtual tags, such +// as +BLOCKED, it is more backwards compatible with how +WAITING virtual tag +// behaved in the past, when waiting had a dedicated status value. bool Task::is_waiting () const { - // note that is_waiting can return true for tasks in an actual status other - // than pending; in this case +WAITING will be set but the status will not be - // "waiting" - if (has ("wait")) + if (has ("wait") && get ("status") == "pending") { Datetime now; Datetime wait (get_date ("wait"));