mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
Integrated Priority column modification to the ColPriority object, from Task core.
This commit is contained in:
parent
55a8b157b1
commit
f39120dd73
6 changed files with 46 additions and 7 deletions
18
src/Task.cpp
18
src/Task.cpp
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue