Change nagging behavior
Don't nag if the specified set of tasks consists only of highest urgency tasks.
This commit is contained in:
committed by
Tomas Babej
parent
4dea5dd944
commit
fb6c42f375
@@ -68,7 +68,7 @@ int CmdDone::execute (std::string&)
|
|||||||
// Accumulated project change notifications.
|
// Accumulated project change notifications.
|
||||||
std::map <std::string, std::string> projectChanges;
|
std::map <std::string, std::string> projectChanges;
|
||||||
|
|
||||||
auto nagged = false;
|
Task& lowest = filtered.front();
|
||||||
for (auto& task : filtered)
|
for (auto& task : filtered)
|
||||||
{
|
{
|
||||||
Task before (task);
|
Task before (task);
|
||||||
@@ -101,8 +101,8 @@ int CmdDone::execute (std::string&)
|
|||||||
++count;
|
++count;
|
||||||
feedback_affected ("Completed task {1} '{2}'.", task);
|
feedback_affected ("Completed task {1} '{2}'.", task);
|
||||||
feedback_unblocked (task);
|
feedback_unblocked (task);
|
||||||
if (!nagged)
|
if (task.urgency () < lowest.urgency ())
|
||||||
nagged = nag (task);
|
lowest = task;
|
||||||
dependencyChainOnComplete (task);
|
dependencyChainOnComplete (task);
|
||||||
if (Context::getContext ().verbose ("project"))
|
if (Context::getContext ().verbose ("project"))
|
||||||
projectChanges[task.get ("project")] = onProjectChange (task);
|
projectChanges[task.get ("project")] = onProjectChange (task);
|
||||||
@@ -124,7 +124,9 @@ int CmdDone::execute (std::string&)
|
|||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nag(lowest);
|
||||||
|
|
||||||
// Now list the project changes.
|
// Now list the project changes.
|
||||||
for (const auto& change : projectChanges)
|
for (const auto& change : projectChanges)
|
||||||
if (change.first != "")
|
if (change.first != "")
|
||||||
|
|||||||
Reference in New Issue
Block a user