Changeset 951


Ignore:
Timestamp:
Sep 28, 2006, 5:17:07 PM (16 years ago)
Author:
livings124
Message:

more logging and an extra check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r950 r951  
    420420        return YES;
    421421   
    422     NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: [self dataLocation]];
     422    NSString * location = [self dataLocation],
     423                * volume = [[[NSFileManager defaultManager] componentsToDisplayForPath: location] objectAtIndex: 0];
     424    NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: location];
    423425    uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue],
    424426            torrentRemaining = [self size] * (uint64_t)(1.0 - [self progress]);
    425427   
    426     NSLog(@"Volume: %@", [[[NSFileManager defaultManager] componentsToDisplayForPath: [self dataLocation]] objectAtIndex: 0]);
     428    NSLog(@"Volume: %@", volume);
    427429    NSLog(@"Remaining disk space: %qu (%@)", remainingSpace, [NSString stringForFileSize: remainingSpace]);
    428430    NSLog(@"Torrent remaining size: %qu (%@)", torrentRemaining, [NSString stringForFileSize: torrentRemaining]);
    429431   
    430     if (remainingSpace <= torrentRemaining)
     432    if (volume && remainingSpace <= torrentRemaining)
    431433    {
    432434        NSAlert * alert = [[NSAlert alloc] init];
     
    434436                                    [self name]]];
    435437        [alert setInformativeText: [NSString stringWithFormat:
    436                         @"The transfer has been paused. Clear up space on %@ to continue.",
    437                         [[[NSFileManager defaultManager] componentsToDisplayForPath: [self dataLocation]] objectAtIndex: 0]]];
     438                        @"The transfer has been paused. Clear up space on %@ to continue.", volume]];
    438439        [alert runModal];
    439440       
Note: See TracChangeset for help on using the changeset viewer.