1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

get the mac os build building again

This commit is contained in:
Mitchell Livingston 2007-07-15 21:57:42 +00:00
parent 7229f6c56b
commit 04f0761d71
3 changed files with 27 additions and 2 deletions

View file

@ -445,7 +445,10 @@
- (void) updateInfoFiles - (void) updateInfoFiles
{ {
if ([fTorrents count] == 1) if ([fTorrents count] == 1)
{
[[fTorrents objectAtIndex: 0] updateFileStat];
[fFileOutline reloadData]; [fFileOutline reloadData];
}
} }
- (void) updateInfoSettings - (void) updateInfoSettings

View file

@ -53,6 +53,7 @@
NSImage * fIcon, * fIconFlipped, * fIconSmall; NSImage * fIcon, * fIconFlipped, * fIconSmall;
NSMutableString * fNameString, * fProgressString, * fStatusString, * fShortStatusString, * fRemainingTimeString; NSMutableString * fNameString, * fProgressString, * fStatusString, * fShortStatusString, * fRemainingTimeString;
tr_file_stat_t * fileStat;
NSArray * fFileList, * fFlatFileList; NSArray * fFileList, * fFlatFileList;
int fUploadLimit, fDownloadLimit; int fUploadLimit, fDownloadLimit;
@ -201,6 +202,9 @@
- (NSArray *) fileList; - (NSArray *) fileList;
- (int) fileCount; - (int) fileCount;
- (void) updateFileStat;
//methods require fileStats to have been updated recently to be accurate
- (float) fileProgress: (int) index; - (float) fileProgress: (int) index;
- (int) checkForFiles: (NSIndexSet *) indexSet; - (int) checkForFiles: (NSIndexSet *) indexSet;
- (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet; - (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet;

View file

@ -170,6 +170,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
- (void) dealloc - (void) dealloc
{ {
if (fileStat)
tr_torrentFilesFree(fileStat, [self fileCount]);
[fDownloadFolder release]; [fDownloadFolder release];
[fIncompleteFolder release]; [fIncompleteFolder release];
@ -1281,9 +1284,21 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return fInfo->fileCount; return fInfo->fileCount;
} }
- (void) updateFileStat
{
if (fileStat)
tr_torrentFilesFree(fileStat, [self fileCount]);
int count;
fileStat = tr_torrentFiles(fHandle, &count);
}
- (float) fileProgress: (int) index - (float) fileProgress: (int) index
{ {
return tr_torrentFileCompletion(fHandle, index); if (!fileStat)
[self updateFileStat];
return fileStat[index].progress;
} }
- (int) checkForFiles: (NSIndexSet *) indexSet - (int) checkForFiles: (NSIndexSet *) indexSet
@ -1308,9 +1323,12 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
if ([self fileCount] <= 1 || [self isComplete]) if ([self fileCount] <= 1 || [self isComplete])
return NO; return NO;
if (!fileStat)
[self updateFileStat];
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 (tr_torrentGetFileStatus(fHandle, index) != TR_CP_COMPLETE) if (fileStat[index].completionStatus != TR_CP_COMPLETE)
return YES; return YES;
return NO; return NO;
} }