Command - count

- Migrated handleCount to CmdCount.
This commit is contained in:
Paul Beckingham
2011-05-28 16:05:07 -04:00
parent 27d6e7cc81
commit a7bc09d487
9 changed files with 114 additions and 35 deletions

View File

@@ -1457,33 +1457,6 @@ int handleDuplicate (std::string& outs)
return rc;
}
////////////////////////////////////////////////////////////////////////////////
int handleCount (std::string& outs)
{
int rc = 0;
// Scan the pending tasks, applying any filter.
std::vector <Task> tasks;
context.tdb.lock (context.config.getBoolean ("locking"));
handleRecurrence ();
context.tdb.load (tasks, context.filter);
context.tdb.commit ();
context.tdb.unlock ();
// Find number of matching tasks. Skip recurring parent tasks.
int count = 0;
std::vector <Task>::iterator it;
for (it = tasks.begin (); it != tasks.end (); ++it)
if (it->getStatus () != Task::recurring)
++count;
std::stringstream out;
out << count << "\n";
outs = out.str ();
return rc;
}
////////////////////////////////////////////////////////////////////////////////
int handleColor (std::string& outs)
{