1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-23 06:30:38 +00:00

remove reliance on completion status

This commit is contained in:
Mitchell Livingston 2007-10-15 18:44:39 +00:00
parent 159f1de576
commit 248837e735

View file

@ -676,15 +676,19 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
- (float) progress - (float) progress
{ {
return fStat->percentComplete; return fStat->percentComplete;
//return (float)[self haveTotal] / [self size];
} }
- (float) progressDone - (float) progressDone
{ {
return fStat->percentDone; return fStat->percentDone;
/*uint64_t have = [self haveTotal];
return (float)have / (have + [self sizeLeft]);*/
} }
- (float) progressLeft - (float) progressLeft
{//NSLog(@"left %f",(float)fStat->leftUntilDone / [self size]); {
//NSLog(@"left %f",(float)fStat->leftUntilDone / [self size]);
return (float)[self sizeLeft] / [self size]; return (float)[self sizeLeft] / [self size];
} }
@ -718,7 +722,8 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
} }
- (float) notAvailableDesired - (float) notAvailableDesired
{//NSLog(@"not available %f", (float)(fStat->desiredSize - fStat->desiredAvailable) / [self size]); {
//NSLog(@"not available %f", (float)(fStat->desiredSize - fStat->desiredAvailable) / [self size]);
return (float)(fStat->desiredSize - fStat->desiredAvailable) / [self size]; return (float)(fStat->desiredSize - fStat->desiredAvailable) / [self size];
} }
@ -1176,7 +1181,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
if (!fileStat) if (!fileStat)
[self updateFileStat]; [self updateFileStat];
return [self fileCount] > 1 && fileStat[index].completionStatus != TR_CP_COMPLETE; return [self fileCount] > 1 && fileStat[index].progress < 1.0;
} }
- (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet - (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet
@ -1189,7 +1194,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
int index; int index;
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index]) for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
if (fileStat[index].completionStatus != TR_CP_COMPLETE) if (fileStat[index].progress < 1.0)
return YES; return YES;
return NO; return NO;
} }