- Added error checking for "recur" without "due"

- Added error checking for "until" without "recur"
- Added status setting for "task add" regarding T::recurring
This commit is contained in:
Paul Beckingham
2008-07-05 02:02:10 -04:00
parent 72c7afe1a1
commit 6c7ad2b398
6 changed files with 28 additions and 6 deletions

View File

@@ -403,6 +403,9 @@ void handleAdd (const TDB& tdb, T& task, Config& conf)
sprintf (entryTime, "%u", (unsigned int) time (NULL));
task.setAttribute ("entry", entryTime);
if (task.getAttribute ("recur") != "")
decorateRecurringTask (task);
if (task.getDescription () == "")
throw std::string ("Cannot add a blank task.");
@@ -3356,3 +3359,15 @@ void nag (const TDB& tdb, T& task, Config& conf)
}
////////////////////////////////////////////////////////////////////////////////
void decorateRecurringTask (T& task)
{
if (task.getAttribute ("due") != "" &&
task.getAttribute ("recur") != "")
{
task.setAttribute ("base", task.getAttribute ("due"));
// TODO Create "range".
}
}
////////////////////////////////////////////////////////////////////////////////