Fix deprecated NSURL to NSString conversion. (#2090)

clang warning:
```
'stringByReplacingPercentEscapesUsingEncoding:' is deprecated: first deprecated in macOS 10.11 - Use -stringByRemovingPercentEncoding instead, which always uses the recommended UTF-8 encoding. [-Wdeprecated-declarations]
```

Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
Dzmitry Neviadomski 2021-11-03 18:04:05 +03:00 committed by GitHub
parent 655050ce70
commit 689063b305
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -983,7 +983,7 @@ static void removeKeRangerRansomware()
NSString* message = [NSString
stringWithFormat:NSLocalizedString(@"It appears that the file \"%@\" from %@ is not a torrent file.", "Download not a torrent -> message"),
suggestedName,
[download.request.URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[download.request.URL.absoluteString stringByRemovingPercentEncoding]];
NSAlert* alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:NSLocalizedString(@"OK", "Download not a torrent -> button")];
@ -1008,7 +1008,7 @@ static void removeKeRangerRansomware()
{
NSString* message = [NSString
stringWithFormat:NSLocalizedString(@"The torrent could not be downloaded from %@: %@.", "Torrent download failed -> message"),
[download.request.URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
[download.request.URL.absoluteString stringByRemovingPercentEncoding],
error.localizedDescription];
NSAlert* alert = [[NSAlert alloc] init];