Bug #605
+ Fixed bug #605, which gave misleading project completion percentages under certain circumstances (thanks to Steve Rader).
This commit is contained in:
@@ -35,6 +35,8 @@
|
|||||||
+ Added feature #714, including Belarus holidays (thanks to Alexei Romanoff).
|
+ Added feature #714, including Belarus holidays (thanks to Alexei Romanoff).
|
||||||
|
|
||||||
# Tracked Bugs, sorted by ID.
|
# Tracked Bugs, sorted by ID.
|
||||||
|
+ Fixed bug #605, which gave misleading project completion percentages under
|
||||||
|
certain circumstances (thanks to Steve Rader).
|
||||||
+ Fixed bug #703, where global substitutions didn't make all expected
|
+ Fixed bug #703, where global substitutions didn't make all expected
|
||||||
annotation changes.
|
annotation changes.
|
||||||
+ Fixed bug #707, which had inverted logic with the urgency calculation for
|
+ Fixed bug #707, which had inverted logic with the urgency calculation for
|
||||||
|
|||||||
@@ -2194,8 +2194,18 @@ std::string onProjectChange (Task& task, bool scope /* = true */)
|
|||||||
countTasks (all, project, context.tdb.getAllModified (), count_pending, count_done);
|
countTasks (all, project, context.tdb.getAllModified (), count_pending, count_done);
|
||||||
countTasks (context.tdb.getAllModified (), project, (std::vector <Task>) NULL, count_pending, count_done);
|
countTasks (context.tdb.getAllModified (), project, (std::vector <Task>) NULL, count_pending, count_done);
|
||||||
|
|
||||||
|
// count_done count_pending percentage
|
||||||
|
// ---------- ------------- ----------
|
||||||
|
// 0 0 0%
|
||||||
|
// >0 0 100%
|
||||||
|
// 0 >0 0%
|
||||||
|
// >0 >0 calculated
|
||||||
int percentage = 0;
|
int percentage = 0;
|
||||||
if (count_done + count_pending > 0)
|
if (count_done == 0)
|
||||||
|
percentage = 0;
|
||||||
|
else if (count_pending == 0)
|
||||||
|
percentage = 100;
|
||||||
|
else
|
||||||
percentage = (count_done * 100 / (count_done + count_pending));
|
percentage = (count_done * 100 / (count_done + count_pending));
|
||||||
|
|
||||||
msg << "Project '"
|
msg << "Project '"
|
||||||
|
|||||||
Reference in New Issue
Block a user