(1.1x) a little extra safety when determining space needed to download

This commit is contained in:
Mitchell Livingston 2008-04-09 18:40:22 +00:00
parent f4e40ec390
commit e66074c1a6
2 changed files with 8 additions and 1 deletions

View File

@ -568,7 +568,13 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
NSDictionary * fileAttributes = onLeopard ? [fileManager attributesOfItemAtPath: path error: NULL]
: [fileManager fileAttributesAtPath: path traverseLink: NO];
if (fileAttributes)
neededSpace -= [[fileAttributes objectForKey: NSFileSize] unsignedLongLongValue];
{
unsigned long long fileSize = [[fileAttributes objectForKey: NSFileSize] unsignedLongLongValue];
if (fileSize < neededSpace)
neededSpace -= fileSize;
else
neededSpace = 0;
}
}
}

View File

@ -497,6 +497,7 @@
[fErrorImage drawInRect: errorRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
}
#warning alter
//text color
NSColor * titleColor, * statusColor;
if ([NSApp isOnLeopardOrBetter] ? [self backgroundStyle] == NSBackgroundStyleDark : [self isHighlighted]