Task: Migrated part of ::modify to ColTags

This commit is contained in:
Paul Beckingham
2016-01-31 17:23:19 -05:00
parent c6f9d2c4b2
commit f0b9ceb17b
3 changed files with 50 additions and 42 deletions

View File

@@ -2006,53 +2006,14 @@ void Task::modify (modType type, bool text_required /* = false */)
evaluatedValue = Variant (value);
}
// Dependencies are specified as IDs.
if (name == "depends")
// Dependencies are specified as IDs or UUIDs.
if (name == "depends" ||
name == "tags")
{
column->modify (*this, value);
mods = true;
}
// For those using the "tags:..." attribute directly.
else if (name == "tags")
{
// TW-1701
set ("tags", "");
std::vector <std::string> tags;
split (tags, value, ',');
for (auto& tag : tags)
{
// If it's a DOM ref, eval it first.
Lexer lexer (tag);
std::string domRef;
Lexer::Type type;
if (lexer.token (domRef, type) &&
type == Lexer::Type::dom)
{
Eval e;
e.addSource (domSource);
e.addSource (namedDates);
contextTask = *this;
Variant v;
e.evaluateInfixExpression (value, v);
addTag ((std::string) v);
context.debug (label + "tags <-- '" + (std::string) v + "' <-- '" + tag + "'");
}
else
{
addTag (tag);
context.debug (label + "tags <-- '" + tag + "'");
}
feedback_special_tags (*this, tag);
}
mods = true;
}
// Dates are special, maybe.
else if (column->type () == "date")
{