Bug 297931

Summary: ktorrent uses different numbers for share ratio in different places
Product: [Applications] ktorrent Reporter: Michael Skiba <opensource>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: RESOLVED FIXED    
Severity: minor    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: ktorrent showing different share ratios

Description Michael Skiba 2012-04-11 21:10:41 UTC
User-Agent:       Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0
Build Identifier: 

Hi everyone,

I'm not sure this really qualifies as bug, more a cosmetic thing probably. But it made me wonder. I see two different numbers for the share ratio. They are clearly related to each other, one is just a tiny bit advanced, so I think this is some sort of systematic error. Maybe one of is updated more often?

Please take a look at the red circles in the screenshot I will attach.
Since there weren't much leecher, this number stayed for quite a while (about half an hour) until ktorrent seeded some more and the numbers got equal again.

But I was able to observe that problem one more time, so I'm wondering is a different algorithm used to calculate the second share ratio? Or is it really just an GUI-Update thing?

(Once again, not that it would really bother me, it just made me wonder if it's known/intended or something going wrong)

Reproducible: Sometimes
Comment 1 Michael Skiba 2012-04-11 21:11:28 UTC
Created attachment 70321 [details]
ktorrent showing different share ratios
Comment 2 Joris Guisson 2012-04-12 17:42:34 UTC
It seems we are using a floating point comparison factor of 0.01 to determine if the view needs to be updated. Need to make that 0.001 and it will be the same for both.
Comment 3 Joris Guisson 2012-04-12 17:43:34 UTC
Git commit 053920c23924e76549dcc20d79dcfb965e10958f by Joris Guisson.
Committed on 12/04/2012 at 19:42.
Pushed by guisson into branch 'master'.

Make float comparison factor smaller in ViewModel when checking if share ratio has changed

M  +1    -0    ChangeLog
M  +2    -2    ktorrent/view/viewmodel.cpp

http://commits.kde.org/ktorrent/053920c23924e76549dcc20d79dcfb965e10958f