diff --git a/macosx/Torrent.m b/macosx/Torrent.m index fdf57120a..77837dcd1 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -488,15 +488,10 @@ int trashDataFile(const char * filename) if ([self allDownloaded] || ![fDefaults boolForKey: @"WarningRemainingSpace"]) return YES; - #warning fix - return YES; - NSFileManager * fileManager = [NSFileManager defaultManager]; - NSString * downloadFolder = [self downloadFolder]; - - NSString * volumeName; - if ((volumeName = [[fileManager componentsToDisplayForPath: downloadFolder] objectAtIndex: 0])) + NSString * downloadFolder = [self currentDirectory], * volumeName; + if (downloadFolder && (volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: downloadFolder] objectAtIndex: 0])) { - NSDictionary * systemAttributes = [fileManager attributesOfFileSystemForPath: downloadFolder error: NULL]; + NSDictionary * systemAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath: downloadFolder error: NULL]; uint64_t remainingSpace = [[systemAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue]; //if the remaining space is greater than the size left, then there is enough space regardless of preallocation