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:
parent
dc068e920f
commit
a84da10766
1 changed files with 3 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue