Feature #574
- Added feature #574, default due dates (thanks to Erlan Sergaziev).
This commit is contained in:
@@ -87,6 +87,15 @@ int handleAdd (std::string& outs)
|
||||
context.task.set ("priority", defaultPriority);
|
||||
}
|
||||
|
||||
// Override with default.due, if not specified.
|
||||
if (context.task.get ("due") == "")
|
||||
{
|
||||
std::string defaultDue = context.config.get ("default.due");
|
||||
if (defaultDue != "" &&
|
||||
Att::validNameValue ("due", "", defaultDue))
|
||||
context.task.set ("due", defaultDue);
|
||||
}
|
||||
|
||||
// Include tags.
|
||||
foreach (tag, context.tagAdditions)
|
||||
context.task.addTag (*tag);
|
||||
@@ -181,6 +190,15 @@ int handleLog (std::string& outs)
|
||||
context.task.set ("priority", defaultPriority);
|
||||
}
|
||||
|
||||
// Override with default.due, if not specified.
|
||||
if (context.task.get ("due") == "")
|
||||
{
|
||||
std::string defaultDue = context.config.get ("default.due");
|
||||
if (defaultDue != "" &&
|
||||
Att::validNameValue ("due", "", defaultDue))
|
||||
context.task.set ("due", defaultDue);
|
||||
}
|
||||
|
||||
// Include tags.
|
||||
foreach (tag, context.tagAdditions)
|
||||
context.task.addTag (*tag);
|
||||
@@ -890,7 +908,7 @@ int handleShow (std::string& outs)
|
||||
"color.sync.added color.sync.changed color.sync.rejected "
|
||||
"color.undo.after confirmation curses data.location dateformat "
|
||||
"dateformat.holiday dateformat.report dateformat.annotation debug "
|
||||
"default.command default.priority default.project defaultwidth due "
|
||||
"default.command default.due default.priority default.project defaultwidth due "
|
||||
"dependency.confirmation dependency.reminder locale displayweeknumber "
|
||||
"export.ical.class echo.command fontunderline gc locking monthsperline "
|
||||
"nag next journal.time journal.time.start.annotation journal.info "
|
||||
|
||||
Reference in New Issue
Block a user