Commit 3b6690bd authored by Felix Paul Kühne's avatar Felix Paul Kühne

coding style fixes

parent 06d1cdf5
......@@ -58,7 +58,7 @@
{
if (buttonIndex == 1) {
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *directoryPath = [searchPaths objectAtIndex:0];
NSString *directoryPath = searchPaths[0];
NSURL *destinationURL = [NSURL URLWithString:[NSString stringWithFormat:@"file://%@/%@", directoryPath, _tempURL.lastPathComponent]];
NSError *theError;
[[NSFileManager defaultManager] copyItemAtURL:_tempURL toURL:destinationURL error:&theError];
......@@ -102,7 +102,7 @@
NSString *directoryPath = @"/Users/fkuehne/Desktop/VideoLAN docs/Clips/sel/";
#else
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *directoryPath = [searchPaths objectAtIndex:0];
NSString *directoryPath = searchPaths[0];
#endif
NSArray *foundFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directoryPath error:nil];
NSMutableArray *filePaths = [NSMutableArray arrayWithCapacity:[foundFiles count]];
......@@ -113,7 +113,7 @@
/* exclude media files from backup (QA1719) */
fileURL = [NSURL URLWithString:[NSString stringWithFormat:@"file://%@/%@", directoryPath, fileName]];
[fileURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:nil];
[fileURL setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
}
}
[[MLMediaLibrary sharedMediaLibrary] addFilePaths:filePaths];
......
......@@ -163,7 +163,7 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
[filesStr appendFormat:@"<a href=\"%@\"> %@ </a><br/>",filePath, [filePath lastPathComponent]];
}
NSString* templatePath = [[config documentRoot] stringByAppendingPathComponent:@"upload.html"];
NSDictionary* replacementDict = [NSDictionary dictionaryWithObject:filesStr forKey:@"MyFiles"];
NSDictionary* replacementDict = @{@"MyFiles": filesStr};
// use dynamic file response to apply our links to response template
return [[HTTPDynamicFileResponse alloc] initWithFilePath:templatePath forConnection:self separator:@"%" replacementDictionary:replacementDict];
}
......@@ -204,8 +204,8 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
// in this sample, we are not interested in parts, other then file parts.
// check content disposition to find out filename
MultipartMessageHeaderField* disposition = [header.fields objectForKey:@"Content-Disposition"];
NSString* filename = [[disposition.params objectForKey:@"filename"] lastPathComponent];
MultipartMessageHeaderField* disposition = (header.fields)[@"Content-Disposition"];
NSString* filename = [(disposition.params)[@"filename"] lastPathComponent];
if ( (nil == filename) || [filename isEqualToString: @""] ) {
// it's either not a file part, or
......
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