mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Merge branch '2.3.0' into 2.4.0
Conflicts: AUTHORS CMakeLists.txt NEWS src/A3.cpp src/CMakeLists.txt src/Config.cpp src/Duration.cpp src/Duration.h src/Nibbler.cpp src/Nibbler.h src/RX.cpp src/RX.h src/columns/ColDate.cpp src/columns/ColScheduled.cpp src/commands/Command.cpp src/legacy.cpp src/utf8.cpp src/utf8.h test/CMakeLists.txt test/bug.mergedeps.t.postponed test/duration.t.cpp test/merge.duplicates.t test/merge.simple_duplication.t test/merge.t test/nibbler.t.cpp test/roundtrip.t test/rx.t.cpp test/utf8.t.cpp
This commit is contained in:
commit
98f740e9d1
550 changed files with 6129 additions and 2976 deletions
|
@ -1,7 +1,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// taskwarrior - a command line task list manager.
|
||||
//
|
||||
// Copyright 2006-2013, Paul Beckingham, Federico Hernandez.
|
||||
// Copyright 2006-2014, Paul Beckingham, Federico Hernandez.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -25,6 +25,7 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <cmake.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
@ -40,7 +41,6 @@
|
|||
#include <util.h>
|
||||
#include <main.h>
|
||||
#include <i18n.h>
|
||||
#include <cmake.h>
|
||||
#ifdef HAVE_COMMIT
|
||||
#include <commit.h>
|
||||
#endif
|
||||
|
@ -152,10 +152,6 @@ int Context::initialize (int argc, const char** argv)
|
|||
// Apply rc overrides to Context::config, capturing raw args for later use.
|
||||
a3.apply_overrides ();
|
||||
|
||||
// Now that the final RC is in place, initialize the urgency coefficients
|
||||
// to speed the 'next' report.
|
||||
initializeUrgencyCoefficients ();
|
||||
|
||||
// Initialize the color rules, if necessary.
|
||||
if (color ())
|
||||
initializeColorRules ();
|
||||
|
@ -166,6 +162,9 @@ int Context::initialize (int argc, const char** argv)
|
|||
// Instantiate built-in column objects.
|
||||
Column::factory (columns);
|
||||
|
||||
// Static initialization to decouple code.
|
||||
staticInitialization ();
|
||||
|
||||
// Categorize all arguments one more time. THIS IS NECESSARY - it helps the
|
||||
// following inject_defaults method determine whether there needs to be a
|
||||
// default command assumed.
|
||||
|
@ -597,6 +596,48 @@ const std::vector <std::string> Context::getCommands () const
|
|||
return output;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// The 'Task' object, among others, is shared between projects. To make this
|
||||
// easier, it has been decoupled from Context.
|
||||
void Context::staticInitialization ()
|
||||
{
|
||||
Task::defaultProject = config.get ("default.project");
|
||||
Task::defaultPriority = config.get ("default.priority");
|
||||
Task::defaultDue = config.get ("default.due");
|
||||
Task::searchCaseSensitive = config.getBoolean ("search.case.sensitive");
|
||||
Task::regex = config.getBoolean ("regex");
|
||||
|
||||
std::map <std::string, Column*>::iterator i;
|
||||
for (i = columns.begin (); i != columns.end (); ++i)
|
||||
Task::attributes[i->first] = i->second->type ();
|
||||
|
||||
Task::urgencyPriorityCoefficient = config.getReal ("urgency.priority.coefficient");
|
||||
Task::urgencyProjectCoefficient = config.getReal ("urgency.project.coefficient");
|
||||
Task::urgencyActiveCoefficient = config.getReal ("urgency.active.coefficient");
|
||||
Task::urgencyScheduledCoefficient = config.getReal ("urgency.scheduled.coefficient");
|
||||
Task::urgencyWaitingCoefficient = config.getReal ("urgency.waiting.coefficient");
|
||||
Task::urgencyBlockedCoefficient = config.getReal ("urgency.blocked.coefficient");
|
||||
Task::urgencyAnnotationsCoefficient = config.getReal ("urgency.annotations.coefficient");
|
||||
Task::urgencyTagsCoefficient = config.getReal ("urgency.tags.coefficient");
|
||||
Task::urgencyNextCoefficient = config.getReal ("urgency.next.coefficient");
|
||||
Task::urgencyDueCoefficient = config.getReal ("urgency.due.coefficient");
|
||||
Task::urgencyBlockingCoefficient = config.getReal ("urgency.blocking.coefficient");
|
||||
Task::urgencyAgeCoefficient = config.getReal ("urgency.age.coefficient");
|
||||
Task::urgencyAgeMax = config.getReal ("urgency.age.max");
|
||||
|
||||
// Tag- and project-specific coefficients.
|
||||
std::vector <std::string> all;
|
||||
config.all (all);
|
||||
|
||||
std::vector <std::string>::iterator var;
|
||||
for (var = all.begin (); var != all.end (); ++var)
|
||||
{
|
||||
if (var->substr (0, 13) == "urgency.user." ||
|
||||
var->substr (0, 12) == "urgency.uda.")
|
||||
Task::coefficients[*var] = config.getReal (*var);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Context::assumeLocations ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue