TW-70: urgency.user.keyword.<keyword>.coefficient=...

- The 'urgency.user.keyword.<keywrod>.coefficient' setting allows for urgency
  adjustments based on description keywords.
This commit is contained in:
Paul Beckingham
2015-04-05 10:25:42 -04:00
parent 79207a8e42
commit 5da3416b79
5 changed files with 21 additions and 1 deletions

View File

@@ -1677,6 +1677,16 @@ float Task::urgency_c () const
if (hasTag (tag))
value += var->second;
}
// urgency.user.keyword.<keyword>.coefficient
if (var->first.substr (13, 8) == "keyword." &&
(end = var->first.find (".coefficient")) != std::string::npos)
{
std::string keyword = var->first.substr (21, end - 21);
if (get ("description").find (keyword) != std::string::npos)
value += var->second;
}
}
else if (var->first.substr (0, 12) == "urgency.uda.")
{

View File

@@ -238,6 +238,7 @@ int CmdShow::execute (std::string& output)
i->first.substr (0, 8) != "default." &&
i->first.substr (0, 21) != "urgency.user.project." &&
i->first.substr (0, 17) != "urgency.user.tag." &&
i->first.substr (0, 21) != "urgency.user.keyword." &&
i->first.substr (0, 12) != "urgency.uda.")
{
unrecognized.push_back (i->first);