mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-25 21:27:19 +02:00
Merge branch '2.4.2' into lexer2
This commit is contained in:
commit
a75c293286
23 changed files with 141 additions and 219 deletions
|
@ -314,6 +314,40 @@ int CmdInfo::execute (std::string& output)
|
|||
view.set (row, 1, allTags);
|
||||
}
|
||||
|
||||
// Virtual tags.
|
||||
{
|
||||
// Note: This list must match that in Task::hasTag.
|
||||
std::string virtualTags = "";
|
||||
if (task->hasTag ("ACTIVE")) virtualTags += "ACTIVE ";
|
||||
if (task->hasTag ("ANNOTATED")) virtualTags += "ANNOTATED ";
|
||||
if (task->hasTag ("BLOCKED")) virtualTags += "BLOCKED ";
|
||||
if (task->hasTag ("BLOCKING")) virtualTags += "BLOCKING ";
|
||||
if (task->hasTag ("CHILD")) virtualTags += "CHILD ";
|
||||
if (task->hasTag ("COMPLETED")) virtualTags += "COMPLETED ";
|
||||
if (task->hasTag ("DELETED")) virtualTags += "DELETED ";
|
||||
if (task->hasTag ("DUE")) virtualTags += "DUE ";
|
||||
if (task->hasTag ("DUETODAY")) virtualTags += "DUETODAY ";
|
||||
if (task->hasTag ("MONTH")) virtualTags += "MONTH ";
|
||||
if (task->hasTag ("OVERDUE")) virtualTags += "OVERDUE ";
|
||||
if (task->hasTag ("PARENT")) virtualTags += "PARENT ";
|
||||
if (task->hasTag ("PENDING")) virtualTags += "PENDING ";
|
||||
if (task->hasTag ("READY")) virtualTags += "READY ";
|
||||
if (task->hasTag ("SCHEDULED")) virtualTags += "SCHEDULED ";
|
||||
if (task->hasTag ("TAGGED")) virtualTags += "TAGGED ";
|
||||
if (task->hasTag ("TODAY")) virtualTags += "TODAY ";
|
||||
if (task->hasTag ("TOMORROW")) virtualTags += "TOMORROW ";
|
||||
if (task->hasTag ("UNBLOCKED")) virtualTags += "UNBLOCKED ";
|
||||
if (task->hasTag ("UNTIL")) virtualTags += "UNTIL ";
|
||||
if (task->hasTag ("WAITING")) virtualTags += "WAITING ";
|
||||
if (task->hasTag ("WEEK")) virtualTags += "WEEK ";
|
||||
if (task->hasTag ("YEAR")) virtualTags += "YEAR ";
|
||||
if (task->hasTag ("YESTERDAY")) virtualTags += "YESTERDAY ";
|
||||
|
||||
row = view.addRow ();
|
||||
view.set (row, 0, STRING_CMD_INFO_VIRTUAL_TAGS);
|
||||
view.set (row, 1, virtualTags);
|
||||
}
|
||||
|
||||
// uuid
|
||||
row = view.addRow ();
|
||||
view.set (row, 0, STRING_COLUMN_LABEL_UUID);
|
||||
|
|
|
@ -53,6 +53,9 @@ int CmdProjects::execute (std::string& output)
|
|||
{
|
||||
int rc = 0;
|
||||
|
||||
// Enforce the garbage collector to show correct task counts
|
||||
context.tdb2.gc ();
|
||||
|
||||
// Get all the tasks.
|
||||
handleRecurrence ();
|
||||
std::vector <Task> tasks = context.tdb2.pending.get_tasks ();
|
||||
|
@ -89,8 +92,16 @@ int CmdProjects::execute (std::string& output)
|
|||
continue;
|
||||
}
|
||||
|
||||
// Increase the count for the project the task belongs to and all
|
||||
// its super-projects
|
||||
project = task->get ("project");
|
||||
unique[project] += 1;
|
||||
|
||||
std::vector <std::string> projects = extractParents (project);
|
||||
projects.push_back (project);
|
||||
|
||||
std::vector <std::string>::const_iterator parent;
|
||||
for (parent = projects.begin (); parent != projects.end (); ++parent)
|
||||
unique[*parent] += 1;
|
||||
|
||||
if (project == "")
|
||||
no_project = true;
|
||||
|
|
|
@ -92,27 +92,34 @@ int CmdSummary::execute (std::string& output)
|
|||
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||
{
|
||||
std::string project = task->get ("project");
|
||||
++counter[project];
|
||||
std::vector <std::string> projects = extractParents (project);
|
||||
projects.push_back (project);
|
||||
|
||||
std::vector <std::string>::const_iterator parent;
|
||||
for (parent = projects.begin (); parent != projects.end (); ++parent)
|
||||
++counter[*parent];
|
||||
|
||||
if (task->getStatus () == Task::pending ||
|
||||
task->getStatus () == Task::waiting)
|
||||
{
|
||||
++countPending[project];
|
||||
for (parent = projects.begin (); parent != projects.end (); ++parent)
|
||||
{
|
||||
++countPending[*parent];
|
||||
|
||||
time_t entry = strtol (task->get ("entry").c_str (), NULL, 10);
|
||||
if (entry)
|
||||
sumEntry[project] = sumEntry[project] + (double) (now - entry);
|
||||
}
|
||||
time_t entry = strtol (task->get ("entry").c_str (), NULL, 10);
|
||||
if (entry)
|
||||
sumEntry[*parent] = sumEntry[*parent] + (double) (now - entry);
|
||||
}
|
||||
|
||||
else if (task->getStatus () == Task::completed)
|
||||
{
|
||||
++countCompleted[project];
|
||||
for (parent = projects.begin (); parent != projects.end (); ++parent)
|
||||
{
|
||||
++countCompleted[*parent];
|
||||
|
||||
time_t entry = strtol (task->get ("entry").c_str (), NULL, 10);
|
||||
time_t end = strtol (task->get ("end").c_str (), NULL, 10);
|
||||
if (entry && end)
|
||||
sumEntry[project] = sumEntry[project] + (double) (end - entry);
|
||||
}
|
||||
time_t entry = strtol (task->get ("entry").c_str (), NULL, 10);
|
||||
time_t end = strtol (task->get ("end").c_str (), NULL, 10);
|
||||
if (entry && end)
|
||||
sumEntry[*parent] = sumEntry[*parent] + (double) (end - entry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue