From 2ecafd5d5e35d4e434e8167b1bb9fd75888e1c85 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 31 Aug 2011 01:39:53 -0400 Subject: [PATCH] Task Validation - Cleaned up 'log' command due to the new validation. --- src/commands/CmdLog.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/commands/CmdLog.cpp b/src/commands/CmdLog.cpp index 2a80894ae..2702e5624 100644 --- a/src/commands/CmdLog.cpp +++ b/src/commands/CmdLog.cpp @@ -51,14 +51,11 @@ int CmdLog::execute (std::string& output) { int rc = 0; - // Every task needs a UUID. - Task task; - task.set ("uuid", uuid ()); - // Apply the command line modifications to the new task. A3 modifications = context.a3.extract_modifications (); + Task task; modify_task_description_replace (task, modifications); - apply_defaults (task); + task.setStatus (Task::completed); // Recurring tasks get a special status. if (task.has ("recur")) @@ -67,15 +64,6 @@ int CmdLog::execute (std::string& output) if (task.has ("wait")) throw std::string (STRING_CMD_LOG_NO_WAITING); - // Override with log-specific changes. - task.setStatus (Task::completed); - - // Provide an end date unless user already specified one. - if (task.get ("end") == "") - task.set ("end", task.get ("entry")); - - // Only valid tasks can be added. - task.validate (); context.tdb2.add (task); /*