generate the file list when a magnetized transfer retrieves its metadata

This commit is contained in:
Mitchell Livingston 2009-11-27 03:44:00 +00:00
parent 47c6ec5efa
commit 740e696f24
1 changed files with 16 additions and 1 deletions

View File

@ -42,8 +42,8 @@
index: (NSInteger) index flatList: (NSMutableArray *) flatFileList;
- (void) completenessChange: (NSNumber *) status;
- (void) ratioLimitHit;
- (void) metadataRetrieved;
- (NSString *) etaString;
@ -62,6 +62,11 @@ void ratioLimitHitCallback(tr_torrent * torrent, void * torrentData)
[(Torrent *)torrentData performSelectorOnMainThread: @selector(ratioLimitHit) withObject: nil waitUntilDone: NO];
}
void metadataCallback(tr_torrent * torrent, void * torrentData)
{
[(Torrent *)torrentData performSelectorOnMainThread: @selector(metadataRetrieved) withObject: nil waitUntilDone: NO];
}
int trashDataFile(const char * filename)
{
if (filename != NULL)
@ -1576,6 +1581,7 @@ int trashDataFile(const char * filename)
tr_torrentSetCompletenessCallback(fHandle, completenessChangeCallback, self);
tr_torrentSetRatioLimitHitCallback(fHandle, ratioLimitHitCallback, self);
tr_torrentSetMetadataCallback(fHandle, metadataCallback, self);
fHashString = [[NSString alloc] initWithUTF8String: fInfo->hashString];
@ -1731,6 +1737,15 @@ int trashDataFile(const char * filename)
fFinishedSeeding = YES;
}
- (void) metadataRetrieved
{
fStat = tr_torrentStat(fHandle);
[self createFileList];
#warning update inspector
}
- (NSString *) etaString
{
const NSInteger eta = [self eta];