This makes the variable naming more uniform. It also clarifies the information we're really trying to convey -- previously, isSingleFile was false whenever the torrent held a directory tree, even if there was only a single file in the tree.
Sync the Mac OS X client's use to match the libtransmission variable names.
{
struct stat sb;
stat (topFile, &sb);
- ret->isSingleFile = !S_ISDIR (sb.st_mode);
+ ret->isFolder = S_ISDIR (sb.st_mode);
}
/* build a list of files containing topFile and,
tr_variantDictReserve (dict, 5);
- if (builder->isSingleFile)
- {
- tr_variantDictAddInt (dict, TR_KEY_length, builder->files[0].size);
- }
- else /* root node is a directory */
+ if (builder->isFolder) /* root node is a directory */
{
uint32_t i;
tr_variant * list = tr_variantDictAddList (dict, TR_KEY_files,
getFileInfo (builder->top, &builder->files[i], length, pathVal);
}
}
+ else
+ {
+ tr_variantDictAddInt (dict, TR_KEY_length, builder->files[0].size);
+ }
base = tr_basename (builder->top);
tr_variantDictAddStr (dict, TR_KEY_name, base);
uint32_t fileCount;
uint32_t pieceSize;
uint32_t pieceCount;
- bool isSingleFile;
+ bool isFolder;
/**
*** These are set inside tr_makeMetaInfo ()
/* Flags */
bool isPrivate;
- bool isMultifile;
+ bool isFolder;
};
static inline bool tr_torrentHasMetadata (const tr_torrent * tor)
//determine to show the options window
const BOOL showWindow = type == ADD_SHOW_OPTIONS || ([fDefaults boolForKey: @"DownloadAsk"]
- && (info.isMultifile || ![fDefaults boolForKey: @"DownloadAskMulti"])
+ && (info.isFolder || ![fDefaults boolForKey: @"DownloadAskMulti"])
&& (type != ADD_AUTO || ![fDefaults boolForKey: @"DownloadAskManual"]));
tr_metainfoFree(&info);
[fNameField setStringValue: name];
[fNameField setToolTip: [fPath path]];
- const BOOL multifile = !fInfo->isSingleFile;
+ const BOOL multifile = fInfo->isFolder;
NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFileType: multifile
? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : [fPath pathExtension]];
if (count == 1)
{
name = [NSString stringWithUTF8String: info.name];
- folder = info.isMultifile;
+ folder = info.isFolder;
}
}
tr_metainfoFree(&info);
NSMutableDictionary * allImgProps = [NSMutableDictionary dictionary];
NSString * name = [NSString stringWithUTF8String: inf.name];
- NSString * fileTypeString = inf.isMultifile ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : [name pathExtension];
+ NSString * fileTypeString = inf.isFolder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : [name pathExtension];
const NSUInteger width = 32;
[htmlString appendFormat: @"<h2><img class=\"icon\" src=\"%@\" width=\"%ld\" height=\"%ld\" />%@</h2>", generateIconData(fileTypeString, width, allImgProps), width, width, name];
NSString * fileSizeString = [NSString stringForFileSize: inf.totalSize];
- if (inf.isMultifile)
+ if (inf.isFolder)
{
NSString * fileCountString;
if (inf.fileCount == 1)
[lists addObject: listSection];
}
- if (inf.isMultifile)
+ if (inf.isFolder)
{
NSMutableString * listSection = [NSMutableString string];
[listSection appendString: @"<table>"];
- (BOOL) isFolder
{
- return fInfo->isMultifile;
+ return fInfo->isFolder;
}
- (uint64_t) size