1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-23 14:40:43 +00:00

restore the check for remaining disk space

This commit is contained in:
Mitchell Livingston 2009-10-25 13:42:22 +00:00
parent dc068e920f
commit a84da10766

View file

@ -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