Dependencies

- Added 'depends' to Config.cpp.
- Added formatting for the 'depends' column.
- Added notes to t.t.cpp regarding missing tests.
This commit is contained in:
Paul Beckingham 2010-07-12 01:45:53 -04:00
parent 90c40dbebf
commit 93e862b367
3 changed files with 34 additions and 7 deletions

View file

@ -226,10 +226,10 @@ std::string Config::defaults =
"alias.export=export.csv # Prefer CSV over iCal export\n"
"alias.export.vcalendar=export.ical # They are the same\n"
"\n"
"# Fields: id,uuid,project,priority,priority_long,entry,entry_time,\n" // TODO
"# start,entry_time,due,recur,recurrence_indicator,age,\n" // TODO
"# age_compact,active,tags,tag_indicator,description,\n" // TODO
"# description_only,end,end_time,countdown,countdown_compact\n" // TODO
"# Fields: id, uuid, project, priority, priority_long, entry, entry_time,\n"
"# start, start_time, end, end_time, due, countdown, countdown_compact,\n"
"# age, age_compact, active, tags, depends, description_only,\n"
"# description, recur, recurrence_indicator, tag_indicator, wait.\n"
"# Description: This report is ...\n"
"# Sort: due+,priority-,project+\n"
"# Filter: pro:x pri:H +bug limit:10\n"
@ -237,8 +237,8 @@ std::string Config::defaults =
"\n"
"# task long\n"
"report.long.description=Lists all task, all data, matching the specified criteria\n"
"report.long.columns=id,project,priority,entry,start,due,recur,countdown,age,tags,description\n"
"report.long.labels=ID,Project,Pri,Added,Started,Due,Recur,Countdown,Age,Tags,Description\n"
"report.long.columns=id,project,priority,entry,start,due,recur,countdown,age,depends,tags,description\n"
"report.long.labels=ID,Project,Pri,Added,Started,Due,Recur,Countdown,Age,Deps,Tags,Description\n"
"report.long.sort=due+,priority-,project+\n"
"report.long.filter=status:pending\n"
"#report.long.dateformat=m/d/Y\n"

View file

@ -591,6 +591,24 @@ int handleCustomReport (const std::string& report, std::string &outs)
}
}
else if (*col == "depends")
{
table.addColumn (columnLabels[*col] != "" ? columnLabels[*col] : "Deps");
table.setColumnWidth (columnCount, Table::minimum);
table.setColumnJustification (columnCount, Table::left);
int row = 0;
std::vector <int> all;
std::string deps;
foreach (task, tasks)
{
task->getDependencies (all);
join (deps, " ", all);
context.hooks.trigger ("format-depends", "depends", deps);
table.addCell (row++, columnCount, deps);
}
}
// Common to all columns.
// Add underline.
if ((context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor")) &&
@ -752,7 +770,8 @@ void validReportColumns (const std::vector <std::string>& columns)
*it != "tag_indicator" &&
*it != "description_only" &&
*it != "description" &&
*it != "wait")
*it != "wait" &&
*it != "depends")
bad.push_back (*it);
if (bad.size ())

View file

@ -140,11 +140,19 @@ int main (int argc, char** argv)
/*
TODO Task::composeCSV
TODO Task::composeYAML
TODO Task::id
TODO Task::*Status
TODO Task::*Tag*
TODO Task::*Annotation*
TODO Task::addDependency
TODO Task::addDependency
TODO Task::removeDependency
TODO Task::removeDependency
TODO Task::getDependencies
TODO Task::getDependencies
*/
// Task::operator==