- Fixed bug #597, which caused a missing project to be counted as a project
  in the projects command (thanks to Steve Rader).
This commit is contained in:
Paul Beckingham 2011-01-03 22:21:51 -05:00
parent 07755e2c56
commit b553954d37
2 changed files with 11 additions and 2 deletions

View file

@ -62,6 +62,8 @@
+ Fixed bug #595, where taskwarrior ignored changes to the wait date during + Fixed bug #595, where taskwarrior ignored changes to the wait date during
the edit command, consequently not changing task status (thanks to Eric the edit command, consequently not changing task status (thanks to Eric
Fluger). Fluger).
+ Fixed bug #597, which caused a missing project to be counted as a project
in the projects command (thanks to Steve Rader).
+ Applied patch to fix bug #613, so that the summary report and the projects + Applied patch to fix bug #613, so that the summary report and the projects
command now consistently show a missing project as "(none)" (thanks to command now consistently show a missing project as "(none)" (thanks to
Steve Rader). Steve Rader).

View file

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