- 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:
15
src/task.cpp
15
src/task.cpp
@@ -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".
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user