Feature #412
- 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:
@@ -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 ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user