Changeset 14290


Ignore:
Timestamp:
Jun 8, 2014, 10:16:01 PM (8 years ago)
Author:
jordan
Message:

(trunk) replace the tr_metainfo_builder.isSingleFile and tr_info.isMultifile fields an 'isFolder' bool in both structs.

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.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/makemeta.c

    r14241 r14290  
    127127    struct stat sb;
    128128    stat (topFile, &sb);
    129     ret->isSingleFile = !S_ISDIR (sb.st_mode);
     129    ret->isFolder = S_ISDIR (sb.st_mode);
    130130  }
    131131
     
    335335  tr_variantDictReserve (dict, 5);
    336336
    337   if (builder->isSingleFile)
    338     {
    339       tr_variantDictAddInt (dict, TR_KEY_length, builder->files[0].size);
    340     }
    341   else /* root node is a directory */
     337  if (builder->isFolder) /* root node is a directory */
    342338    {
    343339      uint32_t  i;
     
    351347          getFileInfo (builder->top, &builder->files[i], length, pathVal);
    352348        }
     349    }
     350  else
     351    {
     352      tr_variantDictAddInt (dict, TR_KEY_length, builder->files[0].size);
    353353    }
    354354
  • trunk/libtransmission/makemeta.h

    r14287 r14290  
    4646    uint32_t                    pieceSize;
    4747    uint32_t                    pieceCount;
    48     bool                        isSingleFile;
     48    bool                        isFolder;
    4949
    5050    /**
  • trunk/libtransmission/transmission.h

    r14225 r14290  
    18371837    /* Flags */
    18381838    bool               isPrivate;
    1839     bool               isMultifile;
     1839    bool               isFolder;
    18401840};
    18411841
  • trunk/macosx/Controller.m

    r14223 r14290  
    954954        //determine to show the options window
    955955        const BOOL showWindow = type == ADD_SHOW_OPTIONS || ([fDefaults boolForKey: @"DownloadAsk"]
    956                                     && (info.isMultifile || ![fDefaults boolForKey: @"DownloadAskMulti"])
     956                                    && (info.isFolder || ![fDefaults boolForKey: @"DownloadAskMulti"])
    957957                                    && (type != ADD_AUTO || ![fDefaults boolForKey: @"DownloadAskManual"]));
    958958        tr_metainfoFree(&info);
  • trunk/macosx/CreatorWindowController.m

    r13492 r14290  
    151151    [fNameField setToolTip: [fPath path]];
    152152   
    153     const BOOL multifile = !fInfo->isSingleFile;
     153    const BOOL multifile = fInfo->isFolder;
    154154   
    155155    NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFileType: multifile
  • trunk/macosx/DragOverlayWindow.m

    r13340 r14290  
    111111                {
    112112                    name = [NSString stringWithUTF8String: info.name];
    113                     folder = info.isMultifile;
     113                    folder = info.isFolder;
    114114                }
    115115            }
  • trunk/macosx/QuickLookPlugin/GeneratePreviewForURL.m

    r13469 r14290  
    6161   
    6262    NSString * name = [NSString stringWithUTF8String: inf.name];
    63     NSString * fileTypeString = inf.isMultifile ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : [name pathExtension];
     63    NSString * fileTypeString = inf.isFolder ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) : [name pathExtension];
    6464   
    6565    const NSUInteger width = 32;
     
    6767   
    6868    NSString * fileSizeString = [NSString stringForFileSize: inf.totalSize];
    69     if (inf.isMultifile)
     69    if (inf.isFolder)
    7070    {
    7171        NSString * fileCountString;
     
    133133    }
    134134   
    135     if (inf.isMultifile)
     135    if (inf.isFolder)
    136136    {
    137137        NSMutableString * listSection = [NSMutableString string];
  • trunk/macosx/Torrent.m

    r14215 r14290  
    643643- (BOOL) isFolder
    644644{
    645     return fInfo->isMultifile;
     645    return fInfo->isFolder;
    646646}
    647647
Note: See TracChangeset for help on using the changeset viewer.