mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
when migrating old blacklists, use URLs instead of string paths and don't hardcode the Application Support folder location
This commit is contained in:
@@ -103,10 +103,9 @@ tr_session * fHandle;
|
|||||||
[fDefaults setObject: blocklistDate forKey: @"BlocklistNewLastUpdate"];
|
[fDefaults setObject: blocklistDate forKey: @"BlocklistNewLastUpdate"];
|
||||||
[fDefaults removeObjectForKey: @"BlocklistLastUpdate"];
|
[fDefaults removeObjectForKey: @"BlocklistLastUpdate"];
|
||||||
|
|
||||||
NSString * blocklistDir = [NSHomeDirectory() stringByAppendingPathComponent:
|
NSURL * blocklistDir = [[[[NSFileManager defaultManager] URLsForDirectory: NSApplicationDirectory inDomains: NSUserDomainMask] objectAtIndex: 0] URLByAppendingPathComponent: @"Transmission/blocklists/"];
|
||||||
@"/Library/Application Support/Transmission/blocklists/"];
|
[[NSFileManager defaultManager] moveItemAtURL: [blocklistDir URLByAppendingPathComponent: @"level1.bin"]
|
||||||
[[NSFileManager defaultManager] moveItemAtPath: [blocklistDir stringByAppendingPathComponent: @"level1.bin"]
|
toURL: [blocklistDir URLByAppendingPathComponent: [NSString stringWithUTF8String: DEFAULT_BLOCKLIST_FILENAME]]
|
||||||
toPath: [blocklistDir stringByAppendingPathComponent: [NSString stringWithUTF8String: DEFAULT_BLOCKLIST_FILENAME]]
|
|
||||||
error: nil];
|
error: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,8 +443,7 @@ tr_session * fHandle;
|
|||||||
{
|
{
|
||||||
NSMutableArray * sounds = [NSMutableArray array];
|
NSMutableArray * sounds = [NSMutableArray array];
|
||||||
|
|
||||||
NSArray * directories = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory,
|
NSArray * directories = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory, NSUserDomainMask | NSLocalDomainMask | NSSystemDomainMask, YES);
|
||||||
NSUserDomainMask | NSLocalDomainMask | NSSystemDomainMask, YES);
|
|
||||||
|
|
||||||
for (NSString * directory in directories)
|
for (NSString * directory in directories)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user