mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Info: Properly breaks out urgency values for UDA coefficients
This commit is contained in:
parent
b19b0f47e5
commit
f9c99624b2
1 changed files with 16 additions and 3 deletions
|
@ -461,12 +461,25 @@ int CmdInfo::execute (std::string& output)
|
||||||
// urgency.uda.<name>.coefficient
|
// urgency.uda.<name>.coefficient
|
||||||
else if (var->first.substr (0, 12) == "urgency.uda.")
|
else if (var->first.substr (0, 12) == "urgency.uda.")
|
||||||
{
|
{
|
||||||
|
// urgency.uda.<name>.coefficient
|
||||||
|
// urgency.uda.<name>.<value>.coefficient
|
||||||
std::string::size_type end = var->first.find (".coefficient");
|
std::string::size_type end = var->first.find (".coefficient");
|
||||||
if (end != std::string::npos)
|
if (end != std::string::npos)
|
||||||
{
|
{
|
||||||
std::string name = var->first.substr (12, end - 12);
|
const std::string uda = var->first.substr (12, end - 12);
|
||||||
if (task->has (name))
|
std::string::size_type dot = uda.find (".");
|
||||||
urgencyTerm (urgencyDetails, "UDA " + name, 1.0, var->second);
|
if (dot == std::string::npos)
|
||||||
|
{
|
||||||
|
// urgency.uda.<name>.coefficient
|
||||||
|
if (task->has (uda))
|
||||||
|
urgencyTerm (urgencyDetails, std::string ("UDA ") + uda, 1.0, var->second);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// urgency.uda.<name>.<value>.coefficient
|
||||||
|
if (task->get (uda.substr(0, dot)) == uda.substr(dot+1))
|
||||||
|
urgencyTerm (urgencyDetails, std::string ("UDA ") + uda, 1.0, var->second);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue