TDB2
- Implemented CmdAdd.cpp and CmdLog.cpp using TDB2. - Implemented simple append writes in TDB2. - Modified CmdImport to accept and parse JSON. - Added more const-ness in DOM, Expression and Task, to allow TDB2::get_tasks to return a const vector ref, which is a Very Good Thing. - Corrected usage for the export command. - Implemented Task::urgency as a call to Task::urgency_c, which is a const overload to allow urgency calculations (without caching) for const Task objects. - Removed obolete code from TDB. - Added lots of diagnostic output for TDB2 - it's annoying, but will be gone soon. - Added mention in CmdHelp of the new <filter> and <modifications> syntax elements. Needs more. - Added Command::filter overload which uses TDB2. Not in use yet.
This commit is contained in:
50
src/TDB.cpp
50
src/TDB.cpp
@@ -317,41 +317,16 @@ int TDB::loadPending (std::vector <Task>& tasks)
|
||||
}
|
||||
|
||||
// Now filter and return.
|
||||
/*
|
||||
if (filter.size ())
|
||||
{
|
||||
foreach (task, mPending)
|
||||
if (filter.pass (*task))
|
||||
tasks.push_back (*task);
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
foreach (task, mPending)
|
||||
tasks.push_back (*task);
|
||||
}
|
||||
foreach (task, mPending)
|
||||
tasks.push_back (*task);
|
||||
|
||||
// Hand back any accumulated additions, if TDB::loadPending is being called
|
||||
// repeatedly.
|
||||
int fakeId = mId;
|
||||
/*
|
||||
if (filter.size ())
|
||||
foreach (task, mNew)
|
||||
{
|
||||
foreach (task, mNew)
|
||||
{
|
||||
task->id = fakeId++;
|
||||
if (filter.pass (*task))
|
||||
tasks.push_back (*task);
|
||||
}
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
foreach (task, mNew)
|
||||
{
|
||||
task->id = fakeId++;
|
||||
tasks.push_back (*task);
|
||||
}
|
||||
task->id = fakeId++;
|
||||
tasks.push_back (*task);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,19 +381,8 @@ int TDB::loadCompleted (std::vector <Task>& tasks)
|
||||
}
|
||||
|
||||
// Now filter and return.
|
||||
/*
|
||||
if (filter.size ())
|
||||
{
|
||||
foreach (task, mCompleted)
|
||||
if (filter.pass (*task))
|
||||
tasks.push_back (*task);
|
||||
}
|
||||
else
|
||||
*/
|
||||
{
|
||||
foreach (task, mCompleted)
|
||||
tasks.push_back (*task);
|
||||
}
|
||||
foreach (task, mCompleted)
|
||||
tasks.push_back (*task);
|
||||
}
|
||||
|
||||
catch (std::string& e)
|
||||
|
||||
Reference in New Issue
Block a user