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,8 +445,11 @@
- (void) updateInfoFiles
{
if ([fTorrents count] == 1)
{
[[fTorrents objectAtIndex: 0] updateFileStat];
[fFileOutline reloadData];
}
}
- (void) updateInfoSettings
{

View file

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

View file

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