1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-28 10:38:45 +00:00

Paths converted from NSString objects to C strings should be acquired using “-fileSystemRepresentation”.

The file system APIs on OS X have specific requirements concerning the Unicode normalization form.
This commit is contained in:
Jan Weiß 2016-05-15 18:42:37 +02:00
parent e60e75fadc
commit 4a9a48853b

View file

@ -845,7 +845,8 @@
[fDefaults setBool: YES forKey: @"DownloadLocationConstant"];
[self updateShowAddMagnetWindowField];
tr_sessionSetDownloadDir(fHandle, [folder UTF8String]);
assert(folder.length > 0);
tr_sessionSetDownloadDir(fHandle, [folder fileSystemRepresentation]);
}
else
{
@ -871,7 +872,8 @@
NSString * folder = [[[panel URLs] objectAtIndex: 0] path];
[fDefaults setObject: folder forKey: @"IncompleteDownloadFolder"];
tr_sessionSetIncompleteDir(fHandle, [folder UTF8String]);
assert(folder.length > 0);
tr_sessionSetIncompleteDir(fHandle, [folder fileSystemRepresentation]);
}
[fIncompleteFolderPopUp selectItemAtIndex: 0];
}];
@ -892,8 +894,10 @@
{
NSString * filePath = [[[panel URLs] objectAtIndex: 0] path];
assert(filePath.length > 0);
[fDefaults setObject: filePath forKey: @"DoneScriptPath"];
tr_sessionSetTorrentDoneScript(fHandle, [filePath UTF8String]);
tr_sessionSetTorrentDoneScript(fHandle, [filePath fileSystemRepresentation]);
[fDefaults setBool: YES forKey: @"DoneScriptEnabled"];
tr_sessionSetTorrentDoneScriptEnabled(fHandle, YES);