mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-1627: 'mon' is replaced with date in project field
- Thanks to James Cline.
This commit is contained in:
parent
51cf195b99
commit
16cee8e263
3 changed files with 8 additions and 24 deletions
1
AUTHORS
1
AUTHORS
|
@ -264,3 +264,4 @@ suggestions:
|
|||
Florian Petry
|
||||
Lars Beckers
|
||||
Dustin J. Mitchell
|
||||
James Cline
|
||||
|
|
|
@ -71,6 +71,7 @@
|
|||
- TW-1622 Duration UDA can't take an algebraic expression (thanks to Jeremy John
|
||||
Reeder).
|
||||
- TW-1626 Wrong wait date (thanks to Andrea Rizzi).
|
||||
- TW-1627 'mon' is replaced with date in project field (thanks to James Cline).
|
||||
- TW-1632 Japanese translation for Taskwarrior(150713) (thanks to ribbon).
|
||||
- TW-1634 due.not:<date> excludes only tasks scheduled at mitnight (thanks to
|
||||
Tomas Babej).
|
||||
|
|
30
src/Task.cpp
30
src/Task.cpp
|
@ -2135,39 +2135,21 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
++modCount;
|
||||
}
|
||||
|
||||
// String type columns may eval, or may not make sense to eval, and
|
||||
// the best way to determine this is to try.
|
||||
// String type columns are not eval'd.
|
||||
else if (column->type () == "string")
|
||||
{
|
||||
std::string evaluated = value;
|
||||
try
|
||||
{
|
||||
Eval e;
|
||||
e.addSource (domSource);
|
||||
e.addSource (namedDates);
|
||||
contextTask = *this;
|
||||
|
||||
Variant v;
|
||||
e.evaluateInfixExpression (value, v);
|
||||
v.cast (Variant::type_string);
|
||||
evaluated = v.get_string ();
|
||||
}
|
||||
|
||||
catch (...) { /* NOP */ }
|
||||
|
||||
// Final default action
|
||||
if (column->validate (evaluated))
|
||||
if (column->validate (value))
|
||||
{
|
||||
if (column->can_modify ())
|
||||
{
|
||||
std::string col_value = column->modify (evaluated);
|
||||
context.debug (label + name + " <-- '" + col_value + "' <-- '" + evaluated + "' <-- '" + value + "'");
|
||||
std::string col_value = column->modify (value);
|
||||
context.debug (label + name + " <-- '" + col_value + "' <-- '" + value + "'");
|
||||
(*this).set (name, col_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
context.debug (label + name + " <-- '" + evaluated + "' <-- '" + value + "'");
|
||||
(*this).set (name, evaluated);
|
||||
context.debug (label + name + " <-- '" + value + "'");
|
||||
(*this).set (name, value);
|
||||
}
|
||||
|
||||
++modCount;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue