Integrated Priority column modification to the ColPriority object, from Task core.

This commit is contained in:
Thomas 2013-06-14 14:42:08 -04:00 committed by Paul Beckingham
parent 55a8b157b1
commit f39120dd73
6 changed files with 46 additions and 7 deletions

View file

@ -1804,12 +1804,6 @@ void Task::modify (
}
}
// Priorities are converted to upper case.
else if (name == "priority")
{
(*this).set (name, upperCase (value));
}
// Dates are special, maybe.
else if (column->type () == "date")
{
@ -1879,9 +1873,19 @@ void Task::modify (
throw format (STRING_UDA_NUMERIC, result);
}
// By default, just add/remove it.
// Try to use modify method, otherwise just continue to the final option.
else if (column->can_modify ())
{
// column->modify () contains the logic for the specific column
// and returns the appropriate value for (*this).set ()
if (column->validate (value))
(*this).set (name, column->modify (value));
else
throw format (STRING_INVALID_MOD, name, value);
}
else
{
// Final default action
if (column->validate (value))
(*this).set (name, value);
else