Feature - #283 verbosity of annotations

- the configuration variable annotation.details now controls the
  verbosity of the output of annotations.
This commit is contained in:
Federico Hernandez 2010-01-14 00:03:52 +01:00
parent b001c2f40b
commit 3aae7b180b
6 changed files with 97 additions and 21 deletions

View file

@ -2113,12 +2113,32 @@ std::string getFullDescription (Task& task)
std::vector <Att> annotations;
task.getAnnotations (annotations);
foreach (anno, annotations)
{
Date dt (atoi (anno->name ().substr (11).c_str ()));
std::string when = dt.toString (context.config.get ("dateformat", "m/d/Y"));
desc += "\n" + when + " " + anno->value ();
}
if (annotations.size () != 0)
switch (context.config.get("annotation.details",2))
{
case 0:
desc = "+" + desc;
break;
case 1:
{
if (annotations.size () > 1)
desc = "+" + desc;
Att anno (annotations.back());
Date dt (atoi (anno.name ().substr (11).c_str ()));
std::string when = dt.toString (context.config.get ("dateformat", "m/d/Y"));
desc += "\n" + when + " " + anno.value ();
}
break;
case 2:
foreach (anno, annotations)
{
Date dt (atoi (anno->name ().substr (11).c_str ()));
std::string when = dt.toString (context.config.get ("dateformat", "m/d/Y"));
desc += "\n" + when + " " + anno->value ();
}
break;
}
return desc;
}