Changeset 1394


Ignore:
Timestamp:
Jan 18, 2007, 3:54:56 AM (15 years ago)
Author:
livings124
Message:

at creation of file hierarchy determine the state of folders

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/FileBrowserCell.m

    r1392 r1394  
    44
    55@implementation FileBrowserCell
     6
     7- (void) awakeFromNib
     8{
     9    [self setLeaf: YES];
     10}
    611
    712- (void) setImage: (NSImage *) image
  • trunk/macosx/FileOutlineView.m

    r1392 r1394  
    3131{
    3232    NSBrowserCell * browserCell = [[[FileBrowserCell alloc] init] autorelease];
    33     [browserCell setLeaf: YES];
    3433    [[self tableColumnWithIdentifier: @"Name"] setDataCell: browserCell];
    3534   
  • trunk/macosx/Torrent.m

    r1389 r1394  
    4646- (NSArray *) createFileList;
    4747- (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings
    48         withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath fileSize: (uint64_t) size;
     48        withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath
     49        fileSize: (uint64_t) size state: (int) state;
    4950- (NSImage *) advancedBar;
    5051- (void) trashFile: (NSString *) path;
     
    12231224            path = @"";
    12241225       
    1225         [self insertPath: pathComponents forSiblings: files withParent: nil previousPath: path fileSize: file->length];
     1226        [self insertPath: pathComponents forSiblings: files withParent: nil previousPath: path
     1227                fileSize: file->length state: NSOnState];
    12261228        [pathComponents autorelease];
    12271229    }
     
    12301232
    12311233- (void) insertPath: (NSMutableArray *) components forSiblings: (NSMutableArray *) siblings
    1232         withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath fileSize: (uint64_t) size
     1234        withParent: (NSMutableDictionary *) parent previousPath: (NSString *) previousPath
     1235        fileSize: (uint64_t) size state: (int) state
    12331236{
    12341237    NSString * name = [components objectAtIndex: 0];
     
    12591262        if (parent)
    12601263            [dict setObject: parent forKey: @"Parent"];
    1261         [dict setObject: [NSNumber numberWithInt: NSOnState] forKey: @"Check"];
     1264        [dict setObject: [NSNumber numberWithInt: state] forKey: @"Check"];
    12621265       
    12631266        [siblings addObject: dict];
     1267    }
     1268    else
     1269    {
     1270        int dictState = [[dict objectForKey: @"Check"] intValue];
     1271        if (dictState != NSMixedState && dictState != state)
     1272            [dict setObject: [NSNumber numberWithInt: NSMixedState] forKey: @"Check"];
    12641273    }
    12651274   
     
    12681277        [components removeObjectAtIndex: 0];
    12691278        [self insertPath: components forSiblings: [dict objectForKey: @"Children"]
    1270                 withParent: dict previousPath: currentPath fileSize: size];
     1279                withParent: dict previousPath: currentPath fileSize: size state: state];
    12711280    }
    12721281}
Note: See TracChangeset for help on using the changeset viewer.