mirror of
https://github.com/transmission/transmission
synced 2024-12-24 16:52:39 +00:00
don't check for speeds to badge that are disabled in prefs
This commit is contained in:
parent
48bec954be
commit
877c824ac2
1 changed files with 4 additions and 9 deletions
|
@ -87,15 +87,10 @@
|
||||||
if ([NSApp isOnLeopardOrBetter])
|
if ([NSApp isOnLeopardOrBetter])
|
||||||
{
|
{
|
||||||
float downloadRate = 0.0, uploadRate = 0.0;
|
float downloadRate = 0.0, uploadRate = 0.0;
|
||||||
BOOL checkDownload = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeDownloadRate"],
|
BOOL badgeDownload = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeDownloadRate"],
|
||||||
checkUpload = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeUploadRate"];
|
badgeUpload = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeUploadRate"];
|
||||||
if (checkDownload || checkUpload)
|
if (badgeDownload || badgeUpload)
|
||||||
{
|
tr_torrentRates(fLib, badgeDownload ? &downloadRate : NULL, badgeUpload ? &uploadRate : NULL);
|
||||||
tr_torrentRates(fLib, &downloadRate, &uploadRate);
|
|
||||||
|
|
||||||
downloadRate = checkDownload ? downloadRate : 0.0;
|
|
||||||
uploadRate = checkUpload ? uploadRate : 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//only update if the badged values change
|
//only update if the badged values change
|
||||||
if ([(BadgeView *)[[NSApp dockTile] contentView] setRatesWithDownload: downloadRate upload: uploadRate])
|
if ([(BadgeView *)[[NSApp dockTile] contentView] setRatesWithDownload: downloadRate upload: uploadRate])
|
||||||
|
|
Loading…
Reference in a new issue