mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Context: Static initialize UDA sort order values
This commit is contained in:
parent
370afa0d26
commit
743cb92958
3 changed files with 16 additions and 0 deletions
|
@ -641,6 +641,19 @@ void Context::staticInitialization ()
|
|||
Lexer::dateFormat = Variant::dateFormat = config.get ("dateformat");
|
||||
Lexer::isoEnabled = Variant::isoEnabled = config.getBoolean ("date.iso");
|
||||
|
||||
Config::const_iterator rc;
|
||||
for (rc = config.begin (); rc != config.end (); ++rc)
|
||||
{
|
||||
if (rc->first.substr (0, 4) == "uda." &&
|
||||
rc->first.substr (rc->first.length () - 7, 7) == ".values")
|
||||
{
|
||||
std::string name = rc->first.substr (4, rc->first.length () - 7 - 4);
|
||||
std::vector <std::string> values;
|
||||
split (values, rc->second, ',');
|
||||
Task::customOrder[name] = values;
|
||||
}
|
||||
}
|
||||
|
||||
std::map <std::string, Column*>::iterator i;
|
||||
for (i = columns.begin (); i != columns.end (); ++i)
|
||||
Task::attributes[i->first] = i->second->type ();
|
||||
|
|
|
@ -87,6 +87,8 @@ float Task::urgencyBlockingCoefficient = 0.0;
|
|||
float Task::urgencyAgeCoefficient = 0.0;
|
||||
float Task::urgencyAgeMax = 0.0;
|
||||
|
||||
std::map <std::string, std::vector <std::string> > Task::customOrder;
|
||||
|
||||
static const std::string dummy ("");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
static bool regex;
|
||||
static std::map <std::string, std::string> attributes; // name -> type
|
||||
static std::map <std::string, float> coefficients;
|
||||
static std::map <std::string, std::vector <std::string> > customOrder;
|
||||
static float urgencyPriorityCoefficient;
|
||||
static float urgencyProjectCoefficient;
|
||||
static float urgencyActiveCoefficient;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue