Changeset 12243


Ignore:
Timestamp:
Mar 27, 2011, 2:50:38 AM (11 years ago)
Author:
livings124
Message:

Attempt to fix #4148 "Mac client gives inappropriate error if data volume is not mounted"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r12227 r12243  
    573573        return YES;
    574574   
    575     NSString * downloadFolder = [self currentDirectory], * volumeName;
    576     if ((volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: downloadFolder] objectAtIndex: 0]))
    577     {
    578         NSDictionary * systemAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath: downloadFolder error: NULL];
    579         uint64_t remainingSpace = [[systemAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue];
     575    NSString * downloadFolder = [self currentDirectory];
     576    NSLog(@"%@", downloadFolder);
     577    NSDictionary * systemAttributes;
     578    if ((systemAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath: downloadFolder error: NULL]))
     579    {
     580        NSLog(@"%@", systemAttributes);
     581        const uint64_t remainingSpace = [[systemAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue];
    580582       
    581583        //if the remaining space is greater than the size left, then there is enough space regardless of preallocation
    582584        if (remainingSpace < [self sizeLeft] && remainingSpace < tr_torrentGetBytesLeftToAllocate(fHandle))
    583585        {
     586            NSString * volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: downloadFolder] objectAtIndex: 0];
     587           
    584588            NSAlert * alert = [[NSAlert alloc] init];
    585589            [alert setMessageText: [NSString stringWithFormat:
Note: See TracChangeset for help on using the changeset viewer.