mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Reuse safe function for fraction
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
1b436a3af8
commit
5c61575c50
|
@ -95,12 +95,7 @@ class EditorView:
|
|||
|
||||
wordCount = validInt(outlineItem.textCount())
|
||||
goal = validInt(outlineItem.goalCount())
|
||||
progress = 0
|
||||
|
||||
if goal > wordCount:
|
||||
progress = 100 * wordCount / goal
|
||||
elif goal > 0:
|
||||
progress = 100
|
||||
progress = 100 * safeFraction(wordCount, 0, goal)
|
||||
|
||||
self.outlineStore.set_value(tree_iter, 0, outlineItem.UID.value)
|
||||
self.outlineStore.set_value(tree_iter, 1, validString(outlineItem.title))
|
||||
|
|
Loading…
Reference in a new issue