Task Validation
- Cleaned up the 'start' and 'stop' commands due to the new validation.
This commit is contained in:
@@ -79,7 +79,6 @@ int CmdStart::execute (std::string& output)
|
|||||||
Task before (*task);
|
Task before (*task);
|
||||||
|
|
||||||
modify_task_annotate (*task, modifications);
|
modify_task_annotate (*task, modifications);
|
||||||
apply_defaults (*task);
|
|
||||||
|
|
||||||
// Add a start time.
|
// Add a start time.
|
||||||
task->setStart ();
|
task->setStart ();
|
||||||
@@ -87,9 +86,6 @@ int CmdStart::execute (std::string& output)
|
|||||||
if (context.config.getBoolean ("journal.time"))
|
if (context.config.getBoolean ("journal.time"))
|
||||||
task->addAnnotation (context.config.get ("journal.time.start.annotation"));
|
task->addAnnotation (context.config.get ("journal.time.start.annotation"));
|
||||||
|
|
||||||
// Only allow valid tasks.
|
|
||||||
task->validate ();
|
|
||||||
|
|
||||||
if (taskDiff (before, *task))
|
if (taskDiff (before, *task))
|
||||||
{
|
{
|
||||||
if (permission.confirmed (before, taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
if (permission.confirmed (before, taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ int CmdStop::execute (std::string& output)
|
|||||||
Task before (*task);
|
Task before (*task);
|
||||||
|
|
||||||
modify_task_annotate (*task, modifications);
|
modify_task_annotate (*task, modifications);
|
||||||
apply_defaults (*task);
|
|
||||||
|
|
||||||
// Remove the start time.
|
// Remove the start time.
|
||||||
task->remove ("start");
|
task->remove ("start");
|
||||||
@@ -86,9 +85,6 @@ int CmdStop::execute (std::string& output)
|
|||||||
if (context.config.getBoolean ("journal.time"))
|
if (context.config.getBoolean ("journal.time"))
|
||||||
task->addAnnotation (context.config.get ("journal.time.stop.annotation"));
|
task->addAnnotation (context.config.get ("journal.time.stop.annotation"));
|
||||||
|
|
||||||
// Only allow valid tasks.
|
|
||||||
task->validate ();
|
|
||||||
|
|
||||||
if (taskDiff (before, *task))
|
if (taskDiff (before, *task))
|
||||||
{
|
{
|
||||||
if (permission.confirmed (before, taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
if (permission.confirmed (before, taskDifferences (before, *task) + STRING_CMD_DONE_PROCEED))
|
||||||
|
|||||||
Reference in New Issue
Block a user