mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
simplify the code to check if an eta string should be displayed
This commit is contained in:
parent
39b92cc682
commit
117e78dce4
1 changed files with 4 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue