mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-1267
- TW-1267 If default.project is defined it's not possible to add a task without a project (thanks to Renato Alves).
This commit is contained in:
parent
5e1f596200
commit
a04df10d11
2 changed files with 31 additions and 31 deletions
|
@ -71,6 +71,8 @@
|
|||
- TW-1263 Command Reference Redesign.
|
||||
- TW-1264 Project | Tags assigned ratio of tasks (thanks to Benjamin Weber).
|
||||
- TW-1265 cannot add UDA with underscore (thanks to Jakub Wilk).
|
||||
- TW-1267 If default.project is defined it's not possible to add a task without
|
||||
a project (thanks to Renato Alves).
|
||||
- TW-1273 Words in task descriptions and annotations are cut-off after a hyphen
|
||||
(thanks to Elias Probst).
|
||||
- TW-1274 Map 'modification' attribute to 'modified' (thanks to jck).
|
||||
|
|
24
src/Task.cpp
24
src/Task.cpp
|
@ -1490,28 +1490,27 @@ void Task::validate (bool applyDefault /* = true */)
|
|||
(! has ("end") || get ("end") == ""))
|
||||
setEnd ();
|
||||
|
||||
if (applyDefault)
|
||||
{
|
||||
// Override with default.project, if not specified.
|
||||
if (applyDefault &&
|
||||
Task::defaultProject != "" &&
|
||||
(! has ("project") || get ("project") == ""))
|
||||
if (Task::defaultProject != "" &&
|
||||
! has ("project"))
|
||||
{
|
||||
if (context.columns["project"]->validate (Task::defaultProject))
|
||||
set ("project", Task::defaultProject);
|
||||
}
|
||||
|
||||
// Override with default.priority, if not specified.
|
||||
if (applyDefault &&
|
||||
Task::defaultPriority != "" &&
|
||||
(! has ("priority") || get ("priority") == ""))
|
||||
if (Task::defaultPriority != "" &&
|
||||
! has ("priority"))
|
||||
{
|
||||
if (context.columns["priority"]->validate (Task::defaultPriority))
|
||||
set ("priority", Task::defaultPriority);
|
||||
}
|
||||
|
||||
// Override with default.due, if not specified.
|
||||
if (applyDefault &&
|
||||
Task::defaultDue != "" &&
|
||||
(! has ("due") || get ("due") == ""))
|
||||
if (Task::defaultDue != "" &&
|
||||
! has ("due"))
|
||||
{
|
||||
if (context.columns["due"]->validate (Task::defaultDue))
|
||||
set ("due", Date (Task::defaultDue).toEpoch ());
|
||||
|
@ -1519,8 +1518,6 @@ void Task::validate (bool applyDefault /* = true */)
|
|||
|
||||
// If a UDA has a default value in the configuration,
|
||||
// override with uda.(uda).default, if not specified.
|
||||
if (applyDefault)
|
||||
{
|
||||
// Gather a list of all UDAs with a .default value
|
||||
std::vector <std::string> udas;
|
||||
Config::const_iterator var;
|
||||
|
@ -1956,8 +1953,9 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
value == "''" ||
|
||||
value == "\"\"")
|
||||
{
|
||||
// Remove attribute if the value is blank.
|
||||
(*this).remove (name);
|
||||
// ::composeF4 will skip if the value is blank, but the presence of
|
||||
// the attribute will prevent ::validate from applying defaults.
|
||||
set (name, "");
|
||||
context.debug (label + name + " <-- ''");
|
||||
++modCount;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue