Bug
- Fixed a divide-by-zero bug in the project completion calculations, that was uncovered by sync testing.
This commit is contained in:
@@ -2874,10 +2874,14 @@ std::string onProjectChange (Task& task, bool scope /* = true */)
|
||||
countTasks (context.tdb.getAllNew (), project, "nope", count_pending, count_done);
|
||||
countTasks (context.tdb.getAllModified (), project, "nope", count_pending, count_done);
|
||||
|
||||
int percentage = 0;
|
||||
if (count_done + count_pending > 0)
|
||||
percentage = (count_done * 100 / (count_done + count_pending));
|
||||
|
||||
msg << "Project '"
|
||||
<< project
|
||||
<< "' is "
|
||||
<< (count_done * 100 / (count_done + count_pending))
|
||||
<< percentage
|
||||
<< "% complete ("
|
||||
<< count_pending
|
||||
<< " of "
|
||||
|
||||
Reference in New Issue
Block a user