mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +00:00
get the mac os build building again
This commit is contained in:
parent
7229f6c56b
commit
04f0761d71
3 changed files with 27 additions and 2 deletions
|
@ -445,7 +445,10 @@
|
|||
- (void) updateInfoFiles
|
||||
{
|
||||
if ([fTorrents count] == 1)
|
||||
{
|
||||
[[fTorrents objectAtIndex: 0] updateFileStat];
|
||||
[fFileOutline reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) updateInfoSettings
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue