1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

Don't assume that a download is a folder if there only is one

file (fixes #36)
This commit is contained in:
Eric Petit 2006-06-20 02:34:34 +00:00
parent ca5f11dc51
commit db26a7e23a
3 changed files with 4 additions and 1 deletions

View file

@ -221,6 +221,7 @@ int tr_metainfoParse( tr_info_t * inf, const char * path,
val = tr_bencDictFind( beInfo, "name" );
strcatUTF8( inf->name, val->val.s.s );
inf->multifile = 1;
inf->fileCount = list->val.l.count;
inf->files = calloc( inf->fileCount * sizeof( tr_file_t ), 1 );
@ -243,6 +244,7 @@ int tr_metainfoParse( tr_info_t * inf, const char * path,
else
{
/* Single-file mode */
inf->multifile = 0;
inf->fileCount = 1;
inf->files = calloc( sizeof( tr_file_t ), 1 );

View file

@ -261,6 +261,7 @@ struct tr_info_s
uint8_t * pieces;
/* Files info */
int multifile;
int fileCount;
tr_file_t * files;
};

View file

@ -571,7 +571,7 @@
fRatioLimit = ratioLimit ? [ratioLimit floatValue] : [fDefaults floatForKey: @"RatioLimit"];
fFinishedSeeding = NO;
NSString * fileType = ( fInfo->fileCount > 1 ) ?
NSString * fileType = fInfo->multifile ?
NSFileTypeForHFSTypeCode('fldr') : [[self name] pathExtension];
fIcon = [[NSWorkspace sharedWorkspace] iconForFileType: fileType];
[fIcon retain];