Merge branch '1.9.4' of tasktools.org:task into 1.9.4

This commit is contained in:
Johannes Schlatow 2011-01-04 21:57:23 +01:00
commit 86f778f504
7 changed files with 48 additions and 12 deletions

View file

@ -250,6 +250,7 @@ int handleProjects (std::string& outs)
std::map <std::string, int> medium;
std::map <std::string, int> low;
std::map <std::string, int> none;
bool no_project = false;
std::string project;
std::string priority;
foreach (t, tasks)
@ -258,6 +259,8 @@ int handleProjects (std::string& outs)
priority = t->get ("priority");
unique[project] += 1;
if (project == "")
no_project = true;
if (priority == "H") high[project] += 1;
else if (priority == "M") medium[project] += 1;
@ -298,7 +301,7 @@ int handleProjects (std::string& outs)
foreach (i, unique)
{
int row = table.addRow ();
table.addCell (row, 0, i->first);
table.addCell (row, 0, (i->first == "" ? "(none)" : i->first));
table.addCell (row, 1, i->second);
table.addCell (row, 2, none[i->first]);
table.addCell (row, 3, low[i->first]);
@ -306,11 +309,15 @@ int handleProjects (std::string& outs)
table.addCell (row, 5, high[i->first]);
}
int number_projects = unique.size ();
if (no_project)
--number_projects;
out << optionalBlankLine ()
<< table.render ()
<< optionalBlankLine ()
<< unique.size ()
<< (unique.size () == 1 ? " project" : " projects")
<< number_projects
<< (number_projects == 1 ? " project" : " projects")
<< " (" << quantity << (quantity == 1 ? " task" : " tasks") << ")\n";
}
else