Browse Source

coding style fixes

Felix Paul Kühne 12 years ago
parent
commit
3b6690bde3
2 changed files with 6 additions and 6 deletions
  1. 3 3
      AspenProject/VLCAppDelegate.m
  2. 3 3
      AspenProject/VLCHTTPUploaderController.m

+ 3 - 3
AspenProject/VLCAppDelegate.m

@@ -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];

+ 3 - 3
AspenProject/VLCHTTPUploaderController.m

@@ -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