From e66074c1a67dd94e361b87c5e148616041e25bb2 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Wed, 9 Apr 2008 18:40:22 +0000 Subject: [PATCH] (1.1x) a little extra safety when determining space needed to download --- macosx/Torrent.m | 8 +++++++- macosx/TorrentCell.m | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index e64c0b895..5151920c9 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -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; + } } } diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index d294a9476..d5a258837 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -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]