- 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

@@ -381,10 +381,8 @@ void parse (
std::string value = arg.substr (colon + 1, std::string::npos);
if (validAttribute (name, value, conf))
{
if (name != "recur" || validDuration (value))
task.setAttribute (name, value);
}
}
// Substitution of description text.
@@ -408,6 +406,14 @@ void parse (
}
}
if (task.getAttribute ("recur") != "" &&
task.getAttribute ("due") == "")
throw std::string ("You cannot specify a recurring task without a due date.");
if (task.getAttribute ("until") != "" &&
task.getAttribute ("recur") == "")
throw std::string ("You cannot specify an until date for a non-recurring task.");
if (validDescription (descCandidate))
task.setDescription (descCandidate);
}