mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
Don't assume that a download is a folder if there only is one
file (fixes #36)
This commit is contained in:
parent
ca5f11dc51
commit
db26a7e23a
3 changed files with 4 additions and 1 deletions
|
@ -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 );
|
||||
|
||||
|
|
|
@ -261,6 +261,7 @@ struct tr_info_s
|
|||
uint8_t * pieces;
|
||||
|
||||
/* Files info */
|
||||
int multifile;
|
||||
int fileCount;
|
||||
tr_file_t * files;
|
||||
};
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue