1
0
Fork 0
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:
Mitchell Livingston 2008-04-25 04:38:08 +00:00
parent 48bec954be
commit 877c824ac2

View file

@ -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])