Changeset 2927


Ignore:
Timestamp:
Aug 26, 2007, 11:49:16 PM (15 years ago)
Author:
livings124
Message:

check Reveal File for multiple files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r2926 r2927  
    618618   
    619619    if (action == @selector(revealFile:))
    620         return [fFileOutline numberOfSelectedRows] > 0
    621                 && [[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT]
    622                 && [[NSFileManager defaultManager] fileExistsAtPath:
    623                     [[[fTorrents objectAtIndex: 0] downloadFolder] stringByAppendingPathComponent:
    624                         [[fFiles objectAtIndex: [fFileOutline selectedRow]] objectForKey: @"Path"]]];
     620    {
     621        if (![[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT])
     622            return NO;
     623       
     624        NSString * downloadFolder = [[fTorrents objectAtIndex: 0] downloadFolder];
     625        NSIndexSet * indexSet = [fFileOutline selectedRowIndexes];
     626        int i;
     627        for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
     628            if ([[NSFileManager defaultManager] fileExistsAtPath:
     629                    [downloadFolder stringByAppendingPathComponent: [[fFiles objectAtIndex: i] objectForKey: @"Path"]]])
     630                return YES;
     631        return NO;
     632    }
    625633   
    626634    if (action == @selector(setCheck:))
Note: See TracChangeset for help on using the changeset viewer.