TW-1704: Task: Use Task::identifier to reference the task

To achieve consistent output, use a helper method to generate a proper
handle - ID for tasks with non-zero ID, UUID otherwise.
This commit is contained in:
Tomas Babej
2015-10-30 00:37:20 +01:00
committed by Paul Beckingham
parent 1236abc7d5
commit 2d25cf6f59
16 changed files with 50 additions and 57 deletions

View File

@@ -80,14 +80,9 @@ int CmdDelete::execute (std::string&)
{
// Delete the specified task.
std::string question;
if (task.id)
question = format (STRING_CMD_DELETE_CONFIRM,
task.id,
task.get ("description"));
else
question = format (STRING_CMD_DELETE_CONFIRM,
task.get ("uuid"),
task.get ("description"));
question = format (STRING_CMD_DELETE_CONFIRM,
task.identifier (true),
task.get ("description"));
task.modify (Task::modAnnotate);
task.setStatus (Task::deleted);
@@ -173,7 +168,7 @@ int CmdDelete::execute (std::string&)
else
{
std::cout << format (STRING_CMD_DELETE_NOT_DEL,
task.id,
task.identifier (true),
task.get ("description"))
<< "\n";
rc = 1;