mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +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])
|
||||
{
|
||||
float downloadRate = 0.0, uploadRate = 0.0;
|
||||
BOOL checkDownload = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeDownloadRate"],
|
||||
checkUpload = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeUploadRate"];
|
||||
if (checkDownload || checkUpload)
|
||||
{
|
||||
tr_torrentRates(fLib, &downloadRate, &uploadRate);
|
||||
|
||||
downloadRate = checkDownload ? downloadRate : 0.0;
|
||||
uploadRate = checkUpload ? uploadRate : 0.0;
|
||||
}
|
||||
BOOL badgeDownload = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeDownloadRate"],
|
||||
badgeUpload = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeUploadRate"];
|
||||
if (badgeDownload || badgeUpload)
|
||||
tr_torrentRates(fLib, badgeDownload ? &downloadRate : NULL, badgeUpload ? &uploadRate : NULL);
|
||||
|
||||
//only update if the badged values change
|
||||
if ([(BadgeView *)[[NSApp dockTile] contentView] setRatesWithDownload: downloadRate upload: uploadRate])
|
||||
|
|
Loading…
Reference in a new issue