- Allows the 'projects' and 'tags' commands to be list all used
  projects/tags, not just the ones used in current pending tasks.
  Controlled by the 'list.all.projects' and 'list.all.tags' configuration
  variables (thanks to Dirk Deimeke).
- Added unit tests.
- Updated man pages.
This commit is contained in:
Paul Beckingham 2010-06-20 13:06:24 -04:00
parent 8572080677
commit 2c7552222a
6 changed files with 171 additions and 8 deletions

View file

@ -187,11 +187,15 @@ int handleProjects (std::string &outs)
if (context.hooks.trigger ("pre-projects-command"))
{
std::stringstream out;
context.filter.push_back (Att ("status", "pending"));
std::vector <Task> tasks;
context.tdb.lock (context.config.getBoolean ("locking"));
int quantity = context.tdb.loadPending (tasks, context.filter);
int quantity;
if (context.config.getBoolean ("list.all.projects"))
quantity = context.tdb.load (tasks, context.filter);
else
quantity = context.tdb.loadPending (tasks, context.filter);
context.tdb.commit ();
context.tdb.unlock ();
@ -318,11 +322,14 @@ int handleTags (std::string &outs)
{
std::stringstream out;
context.filter.push_back (Att ("status", "pending"));
std::vector <Task> tasks;
context.tdb.lock (context.config.getBoolean ("locking"));
int quantity = context.tdb.loadPending (tasks, context.filter);
int quantity = 0;
if (context.config.getBoolean ("list.all.tags"))
quantity += context.tdb.load (tasks, context.filter);
else
quantity += context.tdb.loadPending (tasks, context.filter);
context.tdb.commit ();
context.tdb.unlock ();