CmdDuplicate

- When duplicating a task, reset the ID, so that TDB2::add can set it properly.
This commit is contained in:
Paul Beckingham 2014-08-16 14:26:05 -04:00
parent 6faf6bb678
commit 69eb9e8df1

View file

@ -70,6 +70,7 @@ int CmdDuplicate::execute (std::string& output)
{ {
// Duplicate the specified task. // Duplicate the specified task.
Task dup (*task); Task dup (*task);
dup.id = 0; // Reset, and TDB2::add will set.
dup.set ("uuid", uuid ()); // Needs a new UUID. dup.set ("uuid", uuid ()); // Needs a new UUID.
dup.remove ("start"); // Does not inherit start date. dup.remove ("start"); // Does not inherit start date.
dup.remove ("end"); // Does not inherit end date. dup.remove ("end"); // Does not inherit end date.