mirror of
https://github.com/transmission/transmission
synced 2025-02-22 14:10:34 +00:00
lazily call tr_torrentGetBytesLeftToAllocate()
This commit is contained in:
parent
db2ca16cf4
commit
bc3159f4ac
1 changed files with 3 additions and 3 deletions
|
@ -550,10 +550,10 @@ void completenessChangeCallback(tr_torrent * torrent, tr_completeness status, vo
|
|||
|
||||
NSDictionary * systemAttributes = onLeopard ? [fileManager attributesOfFileSystemForPath: downloadFolder error: NULL]
|
||||
: [fileManager fileSystemAttributesAtPath: downloadFolder];
|
||||
uint64_t remainingSpace = [[systemAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue],
|
||||
neededSpace = tr_torrentGetBytesLeftToAllocate(fHandle);
|
||||
uint64_t remainingSpace = [[systemAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue];
|
||||
|
||||
if (remainingSpace < neededSpace)
|
||||
//if the size left is less then remaining space, then there is enough space regardless of preallocation
|
||||
if (remainingSpace < [self sizeLeft] && remainingSpace < tr_torrentGetBytesLeftToAllocate(fHandle))
|
||||
{
|
||||
NSAlert * alert = [[NSAlert alloc] init];
|
||||
[alert setMessageText: [NSString stringWithFormat:
|
||||
|
|
Loading…
Reference in a new issue