mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Code Cleanup
- Remove duplicate modify call to TDB2. - Check if quitting in bulk change only if permission fails. - Correct test logic (the unit for each operation is the second, not the day). - Consistency in test for feature.1013.t - Correctly color deleted tasks. test
This commit is contained in:
parent
39456a3243
commit
160260ff48
13 changed files with 34 additions and 35 deletions
|
@ -117,10 +117,10 @@ int CmdAnnotate::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_ANNO_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -117,10 +117,10 @@ int CmdAppend::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_APPEND_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -141,10 +141,10 @@ int CmdDelete::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_DELETE_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -130,10 +130,10 @@ int CmdDenotate::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_DENO_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -99,7 +99,6 @@ int CmdDone::execute (std::string& output)
|
|||
++count;
|
||||
feedback_affected (STRING_CMD_DONE_TASK, *task);
|
||||
feedback_unblocked (*task);
|
||||
context.tdb2.modify (*task);
|
||||
if (!nagged)
|
||||
nagged = nag (*task);
|
||||
dependencyChainOnComplete (*task);
|
||||
|
@ -109,10 +108,10 @@ int CmdDone::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_DONE_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -123,10 +123,10 @@ int CmdDuplicate::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_DUPLICATE_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -160,10 +160,10 @@ int CmdModify::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_MODIFY_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,10 +117,10 @@ int CmdPrepend::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_PREPEND_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
|
||||
// Now list the project changes.
|
||||
|
|
|
@ -102,10 +102,10 @@ int CmdStart::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_START_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -98,10 +98,10 @@ int CmdStop::execute (std::string& output)
|
|||
else
|
||||
{
|
||||
std::cout << STRING_CMD_STOP_NO << "\n";
|
||||
rc = 1;
|
||||
rc = 1;
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
if (_permission_quit)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -273,7 +273,7 @@ static void colorizeCompleted (Task& task, const Color& base, Color& c)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
static void colorizeDeleted (Task& task, const Color& base, Color& c)
|
||||
{
|
||||
if (task.getStatus () == Task::completed)
|
||||
if (task.getStatus () == Task::deleted)
|
||||
c.blend (base);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue