From 117e78dce40eaa43bc92c943c80aae37d31a8e06 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 14 Aug 2010 17:51:04 +0000 Subject: [PATCH] simplify the code to check if an eta string should be displayed --- macosx/Torrent.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index f8bb4d02f..2c40de74e 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1812,11 +1812,11 @@ int trashDataFile(const char * filename) return YES; else if ([self isSeeding]) { - if (tr_torrentGetSeedRatio(fHandle, NULL)) + if (fStat->eta != TR_ETA_NOT_AVAIL && fStat->eta != TR_ETA_UNKNOWN) return YES; - if (tr_torrentGetSeedIdle(fHandle, NULL)) - return (fStat->etaIdle != TR_ETA_NOT_AVAIL && fStat->etaIdle != TR_ETA_UNKNOWN) && fStat->etaIdle < ETA_IDLE_DISPLAY_SEC; + if (fStat->etaIdle != TR_ETA_NOT_AVAIL && fStat->etaIdle < ETA_IDLE_DISPLAY_SEC) + return YES; } return NO; @@ -1825,8 +1825,7 @@ int trashDataFile(const char * filename) - (NSString *) etaString { const BOOL etaReg = fStat->eta != TR_ETA_NOT_AVAIL && fStat->eta != TR_ETA_UNKNOWN; - const BOOL etaIdleSeed = fStat->etaIdle != TR_ETA_NOT_AVAIL && fStat->etaIdle != TR_ETA_UNKNOWN - && fStat->etaIdle < ETA_IDLE_DISPLAY_SEC; + const BOOL etaIdleSeed = fStat->etaIdle != TR_ETA_NOT_AVAIL && fStat->etaIdle < ETA_IDLE_DISPLAY_SEC; NSInteger eta; if (etaReg && etaIdleSeed)