mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Fix matching project name during urgency calculation
This commit is contained in:
parent
9c2affa0cb
commit
af6f2b55ec
2 changed files with 10 additions and 2 deletions
|
@ -1841,6 +1841,7 @@ float Task::urgency_c () const
|
|||
value += fabsf (Task::urgencyBlockingCoefficient) > epsilon ? (urgency_blocking () * Task::urgencyBlockingCoefficient) : 0.0;
|
||||
value += fabsf (Task::urgencyAgeCoefficient) > epsilon ? (urgency_age () * Task::urgencyAgeCoefficient) : 0.0;
|
||||
|
||||
const std::string taskProjectName = get("project");
|
||||
// Tag- and project-specific coefficients.
|
||||
for (auto& var : Task::coefficients)
|
||||
{
|
||||
|
@ -1855,9 +1856,12 @@ float Task::urgency_c () const
|
|||
{
|
||||
std::string project = var.first.substr (21, end - 21);
|
||||
|
||||
if (get ("project").find (project) == 0)
|
||||
if (taskProjectName == project ||
|
||||
taskProjectName.find(project + '.') == 0)
|
||||
{
|
||||
value += var.second;
|
||||
}
|
||||
}
|
||||
|
||||
// urgency.user.tag.<tag>.coefficient
|
||||
if (var.first.substr (13, 4) == "tag." &&
|
||||
|
|
|
@ -468,9 +468,13 @@ int CmdInfo::execute (std::string& output)
|
|||
(end = var.first.find (".coefficient")) != std::string::npos)
|
||||
{
|
||||
auto project = var.first.substr (21, end - 21);
|
||||
if (task.get ("project").find (project) == 0)
|
||||
const std::string taskProjectName = task.get("project");
|
||||
if (taskProjectName == project ||
|
||||
taskProjectName.find(project + '.') == 0)
|
||||
{
|
||||
urgencyTerm (urgencyDetails, "PROJECT " + project, 1.0, var.second);
|
||||
}
|
||||
}
|
||||
|
||||
// urgency.user.tag.<tag>.coefficient
|
||||
if (var.first.substr (13, 4) == "tag." &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue