Changeset 7053


Ignore:
Timestamp:
Nov 5, 2008, 1:09:39 PM (12 years ago)
Author:
livings124
Message:

lazily call tr_torrentGetBytesLeftToAllocate()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r7052 r7053  
    551551        NSDictionary * systemAttributes = onLeopard ? [fileManager attributesOfFileSystemForPath: downloadFolder error: NULL]
    552552                                            : [fileManager fileSystemAttributesAtPath: downloadFolder];
    553         uint64_t remainingSpace = [[systemAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue],
    554                 neededSpace = tr_torrentGetBytesLeftToAllocate(fHandle);
    555        
    556         if (remainingSpace < neededSpace)
     553        uint64_t remainingSpace = [[systemAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue];
     554       
     555        //if the size left is less then remaining space, then there is enough space regardless of preallocation
     556        if (remainingSpace < [self sizeLeft] && remainingSpace < tr_torrentGetBytesLeftToAllocate(fHandle))
    557557        {
    558558            NSAlert * alert = [[NSAlert alloc] init];
Note: See TracChangeset for help on using the changeset viewer.