mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 02:17:21 +02:00
Code Cleanup
- The "next" command had two control paths. One was via custom reports (correct) and the other was a residual handler (obsolete), which is now removed. This also simplifies a handleCustomReport/runCustomReport issue.
This commit is contained in:
parent
307027a1d9
commit
254b418708
3 changed files with 1 additions and 71 deletions
|
@ -742,74 +742,6 @@ int handleReportSummary (std::string &outs)
|
|||
return rc;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// A summary of the most important pending tasks.
|
||||
//
|
||||
// For every project, pull important tasks to present as an 'immediate' task
|
||||
// list. This hides the overwhelming quantity of other tasks.
|
||||
//
|
||||
// Present at most three tasks for every project. Select the tasks using
|
||||
// these criteria:
|
||||
// - due:< 1wk, pri:*
|
||||
// - due:*, pri:H
|
||||
// - pri:H
|
||||
// - due:*, pri:M
|
||||
// - pri:M
|
||||
// - due:*, pri:L
|
||||
// - pri:L
|
||||
// - due:*, pri:* <-- everything else
|
||||
//
|
||||
// Make the "three" tasks a configurable number
|
||||
//
|
||||
int handleReportNext (std::string &outs)
|
||||
{
|
||||
// Load report configuration.
|
||||
std::string columnList = context.config.get ("report.next.columns");
|
||||
std::string labelList = context.config.get ("report.next.labels");
|
||||
std::string sortList = context.config.get ("report.next.sort");
|
||||
std::string filterList = context.config.get ("report.next.filter");
|
||||
|
||||
std::vector <std::string> filterArgs;
|
||||
split (filterArgs, filterList, ' ');
|
||||
{
|
||||
Cmd cmd ("next");
|
||||
Task task;
|
||||
Sequence sequence;
|
||||
Subst subst;
|
||||
Filter filter;
|
||||
context.parse (filterArgs, cmd, task, sequence, subst, filter);
|
||||
|
||||
context.sequence.combine (sequence);
|
||||
|
||||
// Allow limit to be overridden by the command line.
|
||||
if (!context.task.has ("limit") && task.has ("limit"))
|
||||
context.task.set ("limit", task.get ("limit"));
|
||||
|
||||
foreach (att, filter)
|
||||
context.filter.push_back (*att);
|
||||
}
|
||||
|
||||
// Get all the tasks.
|
||||
std::vector <Task> tasks;
|
||||
context.tdb.lock (context.config.getBoolean ("locking"));
|
||||
handleRecurrence ();
|
||||
context.tdb.load (tasks, context.filter);
|
||||
context.tdb.commit ();
|
||||
context.tdb.unlock ();
|
||||
|
||||
// Restrict to matching subset.
|
||||
gatherNextTasks (tasks);
|
||||
|
||||
return runCustomReport (
|
||||
"next",
|
||||
columnList,
|
||||
labelList,
|
||||
sortList,
|
||||
filterList,
|
||||
tasks,
|
||||
outs);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Year Month Added Completed Deleted
|
||||
// 2006 November 87 63 14
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue