Bug
- The modify command no longer claims that a task was modified if no changes were applied.
This commit is contained in:
43
src/TDB2.cpp
43
src/TDB2.cpp
@@ -551,29 +551,32 @@ void TDB2::modify (Task& task)
|
|||||||
Task original;
|
Task original;
|
||||||
get (task.get ("uuid"), original);
|
get (task.get ("uuid"), original);
|
||||||
|
|
||||||
std::string status = original.get ("status");
|
if (taskDiff (original, task))
|
||||||
if (status == "pending" ||
|
|
||||||
status == "waiting" ||
|
|
||||||
status == "recurring")
|
|
||||||
{
|
{
|
||||||
pending.modify_task (task);
|
std::string status = original.get ("status");
|
||||||
}
|
if (status == "pending" ||
|
||||||
else
|
status == "waiting" ||
|
||||||
{
|
status == "recurring")
|
||||||
completed.modify_task (task);
|
{
|
||||||
}
|
pending.modify_task (task);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
completed.modify_task (task);
|
||||||
|
}
|
||||||
|
|
||||||
// time <time>
|
// time <time>
|
||||||
// old <task>
|
// old <task>
|
||||||
// new <task>
|
// new <task>
|
||||||
// ---
|
// ---
|
||||||
undo.add_line ("time " + Date ().toEpochString () + "\n");
|
undo.add_line ("time " + Date ().toEpochString () + "\n");
|
||||||
undo.add_line ("old " + original.composeF4 ());
|
undo.add_line ("old " + original.composeF4 ());
|
||||||
undo.add_line ("new " + task.composeF4 ());
|
undo.add_line ("new " + task.composeF4 ());
|
||||||
undo.add_line ("---\n");
|
undo.add_line ("---\n");
|
||||||
|
|
||||||
// Add modified task to backlog.
|
// Add modified task to backlog.
|
||||||
backlog.add_task (task);
|
backlog.add_task (task);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -749,9 +749,8 @@ void Task::removeDependency (const std::string& uuid)
|
|||||||
std::string combined;
|
std::string combined;
|
||||||
join (combined, ",", deps);
|
join (combined, ",", deps);
|
||||||
set ("depends", combined);
|
set ("depends", combined);
|
||||||
|
recalc_urgency = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
recalc_urgency = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -762,8 +761,6 @@ void Task::removeDependency (int id)
|
|||||||
removeDependency (uuid);
|
removeDependency (uuid);
|
||||||
else
|
else
|
||||||
throw std::string (STRING_TASK_DEPEND_NO_UUID);
|
throw std::string (STRING_TASK_DEPEND_NO_UUID);
|
||||||
|
|
||||||
recalc_urgency = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ int CmdModify::execute (std::string& output)
|
|||||||
Task before (*task);
|
Task before (*task);
|
||||||
modify_task_description_replace (*task, modifications);
|
modify_task_description_replace (*task, modifications);
|
||||||
|
|
||||||
if (permission.confirmed (*task, taskDifferences (before, *task) + "Proceed with change?"))
|
if (taskDiff (before, *task) &&
|
||||||
|
permission.confirmed (*task, taskDifferences (before, *task) + "Proceed with change?"))
|
||||||
{
|
{
|
||||||
++count;
|
++count;
|
||||||
context.tdb2.modify (*task);
|
context.tdb2.modify (*task);
|
||||||
|
|||||||
Reference in New Issue
Block a user