Changeset 9151


Ignore:
Timestamp:
Sep 20, 2009, 8:58:13 PM (13 years ago)
Author:
livings124
Message:

use NSSearchPathForDirectoriesInDomains() for searching for sounds

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/CreatorWindowController.m

    r9141 r9151  
    143143    [fNameField setToolTip: fPath];
    144144   
    145     BOOL multifile = !fInfo->isSingleFile;
     145    const BOOL multifile = !fInfo->isSingleFile;
    146146   
    147147    NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFileType: multifile
     
    163163    [fStatusField setStringValue: statusString];
    164164   
    165     const int piecesCount = fInfo->pieceCount;
    166     if (piecesCount == 1)
     165    if (fInfo->pieceCount == 1)
    167166        [fPiecesField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"1 piece, %@", "Create torrent -> info"),
    168167                                                            [NSString stringForFileSize: fInfo->pieceSize]]];
    169168    else
    170169        [fPiecesField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d pieces, %@ each", "Create torrent -> info"),
    171                                                             piecesCount, [NSString stringForFileSize: fInfo->pieceSize]]];
     170                                                            fInfo->pieceCount, [NSString stringForFileSize: fInfo->pieceSize]]];
    172171   
    173172    fLocation = [[[[fDefaults stringForKey: @"CreatorLocation"] stringByExpandingTildeInPath] stringByAppendingPathComponent:
  • trunk/macosx/PrefsController.m

    r9126 r9151  
    420420    NSMutableArray * sounds = [NSMutableArray array];
    421421   
    422     NSArray * directories = [NSArray arrayWithObjects: @"/System/Library/Sounds", @"/Library/Sounds", @"Library/Sounds", nil];
     422    NSArray * directories = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory,
     423                                NSUserDomainMask | NSLocalDomainMask | NSSystemDomainMask, YES);
    423424   
    424425    for (NSString * directory in directories)
    425426    {
     427        directory = [directory stringByAppendingPathComponent: @"Sounds"];
     428       
    426429        BOOL isDirectory;
    427430        if ([[NSFileManager defaultManager] fileExistsAtPath: directory isDirectory: &isDirectory] && isDirectory)
Note: See TracChangeset for help on using the changeset viewer.