TW-1827: Extract annotations from a task

- Thanks to Ryan.
This commit is contained in:
Paul Beckingham 2017-01-16 16:00:16 -05:00
parent fdd55bc422
commit 5206b4a84b
7 changed files with 40 additions and 0 deletions

View file

@ -167,6 +167,7 @@ bool getDOM (const std::string& name, Variant& value)
// <date>.second
//
// Annotations (entry is a date):
// annotations.count
// annotations.<N>.entry
// annotations.<N>.description
//
@ -298,6 +299,12 @@ bool getDOM (const std::string& name, const Task& task, Variant& value)
}
}
if (ref.data.size () && size == 2 && elements[0] == "annotations" && elements[1] == "count")
{
value = Variant (static_cast<int> (ref.getAnnotationCount ()));
return true;
}
if (ref.data.size () && size == 3 && elements[0] == "annotations")
{
auto annos = ref.getAnnotations ();