1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +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]) 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])