Commit 6a9424bc authored by Felix Paul Kühne's avatar Felix Paul Kühne

http downloading: prettify some strings

(cherry picked from commit 5a2403c7)
parent 1dd7fde4
......@@ -166,8 +166,8 @@
if (!_httpDownloader.downloadInProgress) {
_currentDownloadType = kVLCDownloadViaHTTP;
if (![_currentDownloadFilename.firstObject isEqualToString:@""]) {
[_httpDownloader downloadFileFromURL:_currentDownloads.firstObject withFileName:_currentDownloadFilename.firstObject];
_humanReadableFilename = [_currentDownloadFilename objectAtIndex:0];
_humanReadableFilename = [[_currentDownloadFilename firstObject] stringByRemovingPercentEncoding];
[_httpDownloader downloadFileFromURL:_currentDownloads.firstObject withFileName:_humanReadableFilename];
} else {
[_httpDownloader downloadFileFromURL:_currentDownloads.firstObject];
_humanReadableFilename = _httpDownloader.userReadableDownloadName;
......@@ -386,9 +386,9 @@
NSInteger row = indexPath.row;
if ([_currentDownloadFilename[row] isEqualToString:@""])
cell.textLabel.text = [_currentDownloads[row] lastPathComponent];
cell.textLabel.text = [[_currentDownloads[row] lastPathComponent] stringByRemovingPercentEncoding];
else
cell.textLabel.text = [_currentDownloadFilename[row] lastPathComponent];
cell.textLabel.text = [[_currentDownloadFilename[row] lastPathComponent] stringByRemovingPercentEncoding];
cell.detailTextLabel.text = [_currentDownloads[row] absoluteString];
......
......@@ -49,7 +49,7 @@
if (fileName)
_fileName = fileName;
else
_fileName = url.lastPathComponent;
_fileName = [url.lastPathComponent stringByRemovingPercentEncoding];
_filePath = [basePath stringByAppendingPathComponent:_fileName];
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:basePath])
......@@ -82,7 +82,7 @@
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *basePath = [searchPaths[0] stringByAppendingPathComponent:@"Upload"];
_fileName = [URL lastPathComponent];
_fileName = [[URL lastPathComponent] stringByRemovingPercentEncoding];
_filePath = [basePath stringByAppendingPathComponent:_fileName];
if (![fileManager fileExistsAtPath:basePath])
[fileManager createDirectoryAtPath:basePath withIntermediateDirectories:YES attributes:nil error:nil];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment