Ignore:
Timestamp:
Aug 30, 2009, 5:50:05 PM (13 years ago)
Author:
livings124
Message:

#2370 On 10.6, revaling files in Finder will select multiple files in the same directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r8969 r9016  
    4444#import "FilterButton.h"
    4545#import "BonjourController.h"
     46#import "NSApplicationAdditions.h"
    4647#import "NSStringAdditions.h"
    4748#import "ExpandedPathToPathTransformer.h"
     
    14101411- (void) revealFile: (id) sender
    14111412{
    1412     for (Torrent * torrent in [fTableView selectedTorrents])
    1413         [torrent revealData];
     1413    NSArray * selected = [fTableView selectedTorrents];
     1414    if ([NSApp isOnSnowLeopardOrBetter])
     1415    {
     1416        NSMutableArray * paths = [NSMutableArray arrayWithCapacity: [selected count]];
     1417        for (Torrent * torrent in [fTableView selectedTorrents])
     1418            [paths addObject: [NSURL fileURLWithPath: [torrent dataLocation]]];
     1419       
     1420        [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: paths];
     1421    }
     1422    else
     1423    {
     1424        for (Torrent * torrent in selected)
     1425            [[NSWorkspace sharedWorkspace] selectFile: [torrent dataLocation] inFileViewerRootedAtPath: nil];
     1426    }
    14141427}
    14151428
     
    40584071    if (([type isEqualToString: GROWL_DOWNLOAD_COMPLETE] || [type isEqualToString: GROWL_SEEDING_COMPLETE])
    40594072            && (location = [clickContext objectForKey: @"Location"]))
    4060         [[NSWorkspace sharedWorkspace] selectFile: location inFileViewerRootedAtPath: nil];
     4073    {
     4074        if ([NSApp isOnSnowLeopardOrBetter])
     4075        {
     4076            NSURL * file = [NSURL fileURLWithPath: location];
     4077            [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs: [NSArray arrayWithObject: file]];
     4078        }
     4079        else
     4080            [[NSWorkspace sharedWorkspace] selectFile: location inFileViewerRootedAtPath: nil];
     4081    }
    40614082}
    40624083
Note: See TracChangeset for help on using the changeset viewer.