Ignore:
Timestamp:
May 28, 2012, 5:43:51 PM (9 years ago)
Author:
livings124
Message:

when migrating old blacklists, use URLs instead of string paths and don't hardcode the Application Support folder location

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PrefsController.m

    r13321 r13322  
    104104            [fDefaults removeObjectForKey: @"BlocklistLastUpdate"];
    105105           
    106             NSString * blocklistDir = [NSHomeDirectory() stringByAppendingPathComponent:
    107                                         @"/Library/Application Support/Transmission/blocklists/"];
    108             [[NSFileManager defaultManager] moveItemAtPath: [blocklistDir stringByAppendingPathComponent: @"level1.bin"]
    109                 toPath: [blocklistDir stringByAppendingPathComponent: [NSString stringWithUTF8String: DEFAULT_BLOCKLIST_FILENAME]]
     106            NSURL * blocklistDir = [[[[NSFileManager defaultManager] URLsForDirectory: NSApplicationDirectory inDomains: NSUserDomainMask] objectAtIndex: 0] URLByAppendingPathComponent: @"Transmission/blocklists/"];
     107            [[NSFileManager defaultManager] moveItemAtURL: [blocklistDir URLByAppendingPathComponent: @"level1.bin"]
     108                toURL: [blocklistDir URLByAppendingPathComponent: [NSString stringWithUTF8String: DEFAULT_BLOCKLIST_FILENAME]]
    110109                error: nil];
    111110        }
     
    445444    NSMutableArray * sounds = [NSMutableArray array];
    446445   
    447     NSArray * directories = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory,
    448                                 NSUserDomainMask | NSLocalDomainMask | NSSystemDomainMask, YES);
     446    NSArray * directories = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory, NSUserDomainMask | NSLocalDomainMask | NSSystemDomainMask, YES);
    449447   
    450448    for (NSString * directory in directories)
Note: See TracChangeset for help on using the changeset viewer.