mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
compare Tasks directly, not their properties
This commit is contained in:
parent
ac24ec1387
commit
e768e2c100
4 changed files with 9 additions and 2 deletions
|
@ -114,6 +114,12 @@ bool Task::operator== (const Task& other)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
bool Task::operator!= (const Task& other)
|
||||||
|
{
|
||||||
|
return !(*this == other);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
Task::Task (const std::string& input)
|
Task::Task (const std::string& input)
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,6 +62,7 @@ public:
|
||||||
public:
|
public:
|
||||||
Task () = default;
|
Task () = default;
|
||||||
bool operator== (const Task&);
|
bool operator== (const Task&);
|
||||||
|
bool operator!= (const Task&);
|
||||||
Task (const std::string&);
|
Task (const std::string&);
|
||||||
Task (const json::object*);
|
Task (const json::object*);
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ void CmdImport::importSingleTask (json::object* obj)
|
||||||
if (hasGeneratedEnd)
|
if (hasGeneratedEnd)
|
||||||
task.set ("end", before.get ("end"));
|
task.set ("end", before.get ("end"));
|
||||||
|
|
||||||
if (before.data_removeme() != task.data_removeme())
|
if (before != task)
|
||||||
{
|
{
|
||||||
CmdModify modHelper;
|
CmdModify modHelper;
|
||||||
modHelper.checkConsistency (before, task);
|
modHelper.checkConsistency (before, task);
|
||||||
|
|
|
@ -79,7 +79,7 @@ int CmdModify::execute (std::string&)
|
||||||
Task before (task);
|
Task before (task);
|
||||||
task.modify (Task::modReplace);
|
task.modify (Task::modReplace);
|
||||||
|
|
||||||
if (before.data_removeme () != task.data_removeme ())
|
if (before != task)
|
||||||
{
|
{
|
||||||
// Abort if change introduces inconsistencies.
|
// Abort if change introduces inconsistencies.
|
||||||
checkConsistency(before, task);
|
checkConsistency(before, task);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue