Change a bunch of NSArray declarations to const collection literals

CQTexperiment
Christopher Snowhill 2022-01-18 18:12:57 -08:00
parent ba0fedf151
commit 684951bdc0
52 changed files with 128 additions and 134 deletions

View File

@ -93,7 +93,7 @@ void* kAppControllerContext = &kAppControllerContext;
/* Yes, this is deprecated. Yes, this is required to give the dialog /* Yes, this is deprecated. Yes, this is required to give the dialog
* a default set of filename extensions to save, including adding an * a default set of filename extensions to save, including adding an
* extension if the user does not supply one. */ * extension if the user does not supply one. */
[p setAllowedFileTypes:[NSArray arrayWithObjects:@"m3u", @"pls", nil]]; [p setAllowedFileTypes:@[@"m3u", @"pls"]];
[p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) { [p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) {
if ( result == NSModalResponseOK ) { if ( result == NSModalResponseOK ) {
@ -117,8 +117,8 @@ void* kAppControllerContext = &kAppControllerContext;
{ {
if (returnCode == NSModalResponseOK) if (returnCode == NSModalResponseOK)
{ {
[playlistLoader willInsertURLs:[NSArray arrayWithObject:[panel url]] origin:URLOriginInternal]; [playlistLoader willInsertURLs:@[[panel url]] origin:URLOriginInternal];
[playlistLoader didInsertURLs:[playlistLoader addURLs:[NSArray arrayWithObject:[panel url]] sort:NO] origin:URLOriginInternal]; [playlistLoader didInsertURLs:[playlistLoader addURLs:@[[panel url]] sort:NO] origin:URLOriginInternal];
} }
} }
@ -401,7 +401,7 @@ void* kAppControllerContext = &kAppControllerContext;
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{ {
NSArray* urls = [NSArray arrayWithObject:[NSURL fileURLWithPath:filename]]; NSArray* urls = @[[NSURL fileURLWithPath:filename]];
[playlistLoader willInsertURLs:urls origin:URLOriginExternal]; [playlistLoader willInsertURLs:urls origin:URLOriginExternal];
[playlistLoader didInsertURLs:[playlistLoader addURLs:urls sort:NO] origin:URLOriginExternal]; [playlistLoader didInsertURLs:[playlistLoader addURLs:urls sort:NO] origin:URLOriginExternal];
return YES; return YES;

View File

@ -218,13 +218,13 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
#elif 0 #elif 0
// Racing with this version is less likely to jam up the main thread // Racing with this version is less likely to jam up the main thread
if ([pe metadataLoaded] != YES) { if ([pe metadataLoaded] != YES) {
NSArray * entries = [NSArray arrayWithObject:pe]; NSArray * entries = @[pe];
[playlistLoader loadInfoForEntries:entries]; [playlistLoader loadInfoForEntries:entries];
} }
#else #else
// Let's do it this way instead // Let's do it this way instead
if ([pe metadataLoaded] != YES && loadData == YES) { if ([pe metadataLoaded] != YES && loadData == YES) {
NSArray *entries = [NSArray arrayWithObject:pe]; NSArray *entries = @[pe];
[playlistLoader performSelectorInBackground:@selector(loadInfoForEntries:) withObject:entries]; [playlistLoader performSelectorInBackground:@selector(loadInfoForEntries:) withObject:entries];
} }
#endif #endif
@ -295,7 +295,7 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
[pboard clearContents]; [pboard clearContents];
[pboard writeObjects:[NSArray arrayWithObjects:[[playlistController currentEntry] spam], nil]]; [pboard writeObjects:@[[[playlistController currentEntry] spam]]];
} }
- (IBAction)eventSeekForward:(id)sender - (IBAction)eventSeekForward:(id)sender
@ -748,7 +748,7 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
{ {
pe = [playlistController getNextEntry:curEntry]; pe = [playlistController getNextEntry:curEntry];
if (pe && [pe metadataLoaded] != YES) { if (pe && [pe metadataLoaded] != YES) {
NSArray * entries = [NSArray arrayWithObject:pe]; NSArray * entries = @[pe];
[playlistLoader performSelectorInBackground:@selector(loadInfoForEntries:) withObject:entries]; [playlistLoader performSelectorInBackground:@selector(loadInfoForEntries:) withObject:entries];
} }
} }

View File

@ -47,6 +47,10 @@ NSArray * sortClassesByPriority(NSArray * theClasses)
return -1.0; return -1.0;
} }
+ (NSArray *)fileTypeAssociations {
return nil;
}
- (id)initWithDecoders:(NSArray *)decoders - (id)initWithDecoders:(NSArray *)decoders
{ {
self = [super init]; self = [super init];
@ -145,6 +149,7 @@ NSArray * sortClassesByPriority(NSArray * theClasses)
} }
} }
@end @end
@implementation CogContainerMulti @implementation CogContainerMulti

View File

@ -111,7 +111,7 @@ static PluginController *sharedPluginController = nil;
for (NSString *pname in dirContents) for (NSString *pname in dirContents)
{ {
NSString *ppath; NSString *ppath;
ppath = [NSString pathWithComponents:[NSArray arrayWithObjects:path,pname,nil]]; ppath = [NSString pathWithComponents:@[path,pname]];
if ([[pname pathExtension] isEqualToString:@"bundle"]) if ([[pname pathExtension] isEqualToString:@"bundle"])
{ {

View File

@ -22,7 +22,7 @@
- (void)updatePath - (void)updatePath
{ {
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:url includingPropertiesForKeys:[NSArray arrayWithObjects:NSURLNameKey, NSURLIsDirectoryKey, nil] options:(NSDirectoryEnumerationSkipsSubdirectoryDescendants | NSDirectoryEnumerationSkipsPackageDescendants | NSDirectoryEnumerationSkipsHiddenFiles) errorHandler:^BOOL(NSURL *url, NSError *error) { NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:url includingPropertiesForKeys:@[NSURLNameKey, NSURLIsDirectoryKey] options:(NSDirectoryEnumerationSkipsSubdirectoryDescendants | NSDirectoryEnumerationSkipsPackageDescendants | NSDirectoryEnumerationSkipsHiddenFiles) errorHandler:^BOOL(NSURL *url, NSError *error) {
return NO; return NO;
}]; }];
NSMutableArray *fullPaths = [[NSMutableArray alloc] init]; NSMutableArray *fullPaths = [[NSMutableArray alloc] init];

View File

@ -48,7 +48,7 @@ static void myFSEventCallback(
[self cleanUp]; [self cleanUp];
//Create FSEvent stream //Create FSEvent stream
NSArray *pathsToWatch = [NSArray arrayWithObject:path]; NSArray *pathsToWatch = @[path];
context = (FSEventStreamContext*)malloc(sizeof(FSEventStreamContext)); context = (FSEventStreamContext*)malloc(sizeof(FSEventStreamContext));
context->version = 0; context->version = 0;

View File

@ -481,7 +481,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
if (([sortDescriptors count] != 0) && [[sortDescriptors[0] key] if (([sortDescriptors count] != 0) && [[sortDescriptors[0] key]
caseInsensitiveCompare:@"index"] == NSOrderedSame) { caseInsensitiveCompare:@"index"] == NSOrderedSame) {
// Remove the sort descriptors // Remove the sort descriptors
[super setSortDescriptors:[NSArray array]]; [super setSortDescriptors:@[]];
[self rearrangeObjects]; [self rearrangeObjects];
return; return;
@ -494,7 +494,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
} }
- (IBAction)randomizeList:(id)sender { - (IBAction)randomizeList:(id)sender {
[self setSortDescriptors:[NSArray array]]; [self setSortDescriptors:@[]];
NSArray *unrandomized = [self content]; NSArray *unrandomized = [self content];
[[[self undoManager] prepareWithInvocationTarget:self] unrandomizeList:unrandomized]; [[[self undoManager] prepareWithInvocationTarget:self] unrandomizeList:unrandomized];
@ -964,7 +964,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
[queueList removeObject:queueItem]; [queueList removeObject:queueItem];
[store queueRemovePlaylistItems:[NSArray arrayWithObject:queueItem]]; [store queueRemovePlaylistItems:@[queueItem]];
} else { } else {
queueItem.queued = YES; queueItem.queued = YES;
queueItem.queuePosition = (int) [queueList count]; queueItem.queuePosition = (int) [queueList count];
@ -991,7 +991,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
queueItem.queuePosition = -1; queueItem.queuePosition = -1;
[queueList removeObject:queueItem]; [queueList removeObject:queueItem];
[store queueRemovePlaylistItems:[NSArray arrayWithObject:queueItem]]; [store queueRemovePlaylistItems:@[queueItem]];
} }
int i = 0; int i = 0;

View File

@ -202,7 +202,7 @@ NSMutableDictionary * dictionaryWithPropertiesOfObject(id obj, NSArray * filterL
} }
[fileHandle truncateFileAtOffset:0]; [fileHandle truncateFileAtOffset:0];
NSArray * filterList = [NSArray arrayWithObjects:@"display", @"length", @"path", @"filename", @"status", @"statusMessage", @"spam", @"lengthText", @"positionText", @"stopAfter", @"shuffleIndex", @"index", @"current", @"queued", @"currentPosition", @"queuePosition", @"error", @"removed", @"URL", @"albumArt", nil]; NSArray * filterList = @[@"display", @"length", @"path", @"filename", @"status", @"statusMessage", @"spam", @"lengthText", @"positionText", @"stopAfter", @"shuffleIndex", @"index", @"current", @"queued", @"currentPosition", @"queuePosition", @"error", @"removed", @"URL", @"albumArt"];
NSMutableDictionary * albumArtSet = [[NSMutableDictionary alloc] init]; NSMutableDictionary * albumArtSet = [[NSMutableDictionary alloc] init];
@ -263,7 +263,7 @@ NSMutableDictionary * dictionaryWithPropertiesOfObject(id obj, NSArray * filterL
for (NSString *subpath in subpaths) for (NSString *subpath in subpaths)
{ {
NSString *absoluteSubpath = [NSString pathWithComponents:[NSArray arrayWithObjects:path,subpath,nil]]; NSString *absoluteSubpath = [NSString pathWithComponents:@[path,subpath]];
BOOL isDir; BOOL isDir;
if ( [manager fileExistsAtPath:absoluteSubpath isDirectory:&isDir] && isDir == NO) if ( [manager fileExistsAtPath:absoluteSubpath isDirectory:&isDir] && isDir == NO)
@ -277,7 +277,7 @@ NSMutableDictionary * dictionaryWithPropertiesOfObject(id obj, NSArray * filterL
} }
NSSortDescriptor * sd_path = [[NSSortDescriptor alloc] initWithKey:@"path" ascending:YES]; NSSortDescriptor * sd_path = [[NSSortDescriptor alloc] initWithKey:@"path" ascending:YES];
[urls sortUsingDescriptors:[NSArray arrayWithObject:sd_path]]; [urls sortUsingDescriptors:@[sd_path]];
return urls; return urls;
} }
@ -312,7 +312,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
if (!urls) if (!urls)
{ {
[self setProgressBarStatus:-1]; [self setProgressBarStatus:-1];
return [NSArray array]; return @[];
} }
if (index < 0) if (index < 0)
@ -468,7 +468,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
if (!count) if (!count)
{ {
[self setProgressBarStatus:-1]; [self setProgressBarStatus:-1];
return [NSArray array]; return @[];
} }
progressstep = 20.0 / (double)(count); progressstep = 20.0 / (double)(count);
@ -539,7 +539,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
[playlistController setSelectionIndexes:[NSIndexSet indexSet]]; [playlistController setSelectionIndexes:[NSIndexSet indexSet]];
{ {
NSArray* arrayFirst = [NSArray arrayWithObject:[entries objectAtIndex:0]]; NSArray* arrayFirst = @[[entries objectAtIndex:0]];
NSMutableArray* arrayRest = [entries mutableCopy]; NSMutableArray* arrayRest = [entries mutableCopy];
[arrayRest removeObjectAtIndex:0]; [arrayRest removeObjectAtIndex:0];
@ -733,7 +733,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
- (NSArray*)addURL:(NSURL *)url - (NSArray*)addURL:(NSURL *)url
{ {
return [self insertURLs:[NSArray arrayWithObject:url] atIndex:(int)[[playlistController content] count] sort:NO]; return [self insertURLs:@[url] atIndex:(int)[[playlistController content] count] sort:NO];
} }
- (NSArray*)addDatabase - (NSArray*)addDatabase
@ -793,7 +793,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
- (NSArray *)acceptablePlaylistTypes - (NSArray *)acceptablePlaylistTypes
{ {
return [NSArray arrayWithObjects:@"m3u", @"pls", nil]; return @[@"m3u", @"pls"];
} }
- (NSArray *)acceptableContainerTypes - (NSArray *)acceptableContainerTypes

View File

@ -89,7 +89,7 @@
if (isArray) { if (isArray) {
items = (NSArray *) plist; items = (NSArray *) plist;
albumArt = nil; albumArt = nil;
queueList = [NSArray array]; queueList = @[];
} else { } else {
NSDictionary *dict = (NSDictionary *) plist; NSDictionary *dict = (NSDictionary *) plist;
items = dict[@"items"]; items = dict[@"items"];

View File

@ -6,11 +6,11 @@
@implementation APLDecoder @implementation APLDecoder
+ (NSArray *)fileTypes { + (NSArray *)fileTypes {
return [NSArray arrayWithObject:@"apl"]; return @[@"apl"];
} }
+ (NSArray *)mimeTypes { + (NSArray *)mimeTypes {
return [NSArray arrayWithObjects:@"application/x-apl", nil]; return @[@"application/x-apl"];
} }
+ (float)priority { + (float)priority {

View File

@ -193,7 +193,7 @@ static CAdPlugDatabase * g_database = NULL;
} }
} }
return array; return [NSArray arrayWithArray:array];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
@ -213,7 +213,7 @@ static CAdPlugDatabase * g_database = NULL;
[ret addObject:@"vg.icns"]; [ret addObject:@"vg.icns"];
[ret addObjectsFromArray:[self fileTypes]]; [ret addObjectsFromArray:[self fileTypes]];
return [NSArray arrayWithObject:ret]; return @[[NSArray arrayWithArray:ret]];
} }
@end @end

View File

@ -26,12 +26,12 @@ static NSString * g_make_unpack_path(NSString * archive, NSString * file, NSStri
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"zip", @"rar", @"7z", @"rsn", @"vgm7z", @"gz", nil]; return @[@"zip", @"rar", @"7z", @"rsn", @"vgm7z", @"gz"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"application/zip", @"application/x-gzip", @"application/x-rar-compressed", @"application/x-7z-compressed", nil]; return @[@"application/zip", @"application/x-gzip", @"application/x-rar-compressed", @"application/x-7z-compressed"];
} }
+ (float)priority + (float)priority
@ -47,14 +47,14 @@ static NSString * g_make_unpack_path(NSString * archive, NSString * file, NSStri
+ (NSArray *)urlsForContainerURL:(NSURL *)url + (NSArray *)urlsForContainerURL:(NSURL *)url
{ {
if (![url isFileURL]) { if (![url isFileURL]) {
return [NSArray array]; return @[];
} }
fex_t * fex; fex_t * fex;
fex_err_t error = fex_open( &fex, [[url path] UTF8String] ); fex_err_t error = fex_open( &fex, [[url path] UTF8String] );
if ( error ) { if ( error ) {
ALog(@"Archive error: %s", error); ALog(@"Archive error: %s", error);
return [NSArray array]; return @[];
} }
NSMutableArray *files = [NSMutableArray array]; NSMutableArray *files = [NSMutableArray array];

View File

@ -181,7 +181,7 @@ static BOOL g_parse_unpack_path(NSString * src, NSString ** archive, NSString **
+ (NSArray *)schemes + (NSArray *)schemes
{ {
return [NSArray arrayWithObject:@"unpack"]; return @[@"unpack"];
} }
- (void)dealloc { - (void)dealloc {

View File

@ -17,12 +17,12 @@
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"cue", @"ogg", @"opus", @"flac", @"wv", @"mp3", nil]; return @[@"cue", @"ogg", @"opus", @"flac", @"wv", @"mp3"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"application/x-cue", nil]; //This is basically useless return @[@"application/x-cue"]; //This is basically useless
} }
+ (float)priority + (float)priority
@ -33,7 +33,7 @@
+ (NSArray *)urlsForContainerURL:(NSURL *)url + (NSArray *)urlsForContainerURL:(NSURL *)url
{ {
if (![url isFileURL]) { if (![url isFileURL]) {
return [NSArray array]; return @[];
} }
if ([url fragment]) { if ([url fragment]) {

View File

@ -586,12 +586,12 @@ int lockmgr_callback(void ** mutex, enum AVLockOp op)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"wma", @"asf", @"tak", @"mp4", @"m4a", @"aac", @"mp3", @"mp2", @"m2a", @"mpa", @"ape", @"ac3", @"dts", @"dtshd", @"wav", @"tta", @"vqf", @"vqe", @"vql", @"ra", @"rm", @"rmj", @"mka", @"weba", nil]; return @[@"wma", @"asf", @"tak", @"mp4", @"m4a", @"aac", @"mp3", @"mp2", @"m2a", @"mpa", @"ape", @"ac3", @"dts", @"dtshd", @"wav", @"tta", @"vqf", @"vqe", @"vql", @"ra", @"rm", @"rmj", @"mka", @"weba"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"application/wma", @"application/x-wma", @"audio/x-wma", @"audio/x-ms-wma", @"audio/x-tak", @"application/ogg", @"audio/aacp", @"audio/mpeg", @"audio/mp4", @"audio/x-mp3", @"audio/x-mp2", @"audio/x-matroska", @"audio/x-ape", @"audio/x-ac3", @"audio/x-dts", @"audio/x-dtshd", @"audio/x-at3", @"audio/wav", @"audio/tta", @"audio/x-tta", @"audio/x-twinvq", nil]; return @[@"application/wma", @"application/x-wma", @"audio/x-wma", @"audio/x-ms-wma", @"audio/x-tak", @"application/ogg", @"audio/aacp", @"audio/mpeg", @"audio/mp4", @"audio/x-mp3", @"audio/x-mp2", @"audio/x-matroska", @"audio/x-ape", @"audio/x-ac3", @"audio/x-dts", @"audio/x-dtshd", @"audio/x-at3", @"audio/wav", @"audio/tta", @"audio/x-tta", @"audio/x-twinvq"];
} }
+ (NSArray *)fileTypeAssociations + (NSArray *)fileTypeAssociations

View File

@ -152,7 +152,7 @@
+ (NSArray *)schemes + (NSArray *)schemes
{ {
return [NSArray arrayWithObject:@"file"]; return @[@"file"];
} }
- (void)dealloc { - (void)dealloc {

View File

@ -353,12 +353,12 @@ void ErrorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"flac", nil]; return @[@"flac"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-flac", nil]; return @[@"audio/x-flac"];
} }
+ (float)priority + (float)priority

View File

@ -18,9 +18,7 @@
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
//There doesn't seem to be a way to get this list. These are the only multitrack types. //There doesn't seem to be a way to get this list. These are the only multitrack types.
return [NSArray arrayWithObjects:@"ay", @"gbs", @"hes", @"kss", @"nsf", @"nsfe", @"sap", @"sgc", return @[@"ay", @"gbs", @"hes", @"kss", @"nsf", @"nsfe", @"sap", @"sgc"];
@"vgm",@"vgz", // These are included so they can override AdPlug
nil];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
@ -41,14 +39,6 @@
return [NSMutableArray arrayWithObject:url]; return [NSMutableArray arrayWithObject:url];
} }
// Dodge both VGMStream and AdPlug
NSString * extension = [url pathExtension];
if (extension && ([extension caseInsensitiveCompare:@"vgm"] == NSOrderedSame ||
[extension caseInsensitiveCompare:@"vgz"] == NSOrderedSame))
{
return [NSMutableArray arrayWithObject:[NSURL URLWithString:[[url absoluteString] stringByAppendingString:@"#0"]]];
}
id audioSourceClass = NSClassFromString(@"AudioSource"); id audioSourceClass = NSClassFromString(@"AudioSource");
id<CogSource> source = [audioSourceClass audioSourceForURL:url]; id<CogSource> source = [audioSourceClass audioSourceForURL:url];
@ -71,7 +61,7 @@
if (NULL != error) { if (NULL != error) {
ALog(@"GME: Error loading file: %@ %s", [url path], error); ALog(@"GME: Error loading file: %@ %s", [url path], error);
return [NSArray arrayWithObject:url]; return @[url];
} }
NSURL *m3uurl = [url URLByDeletingPathExtension]; NSURL *m3uurl = [url URLByDeletingPathExtension];

View File

@ -209,7 +209,7 @@ gme_err_t readCallback( void* data, void* out, long count )
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"ay", @"gbs", @"hes", @"kss", @"nsf", @"nsfe", @"sap", @"sfm", @"sgc", @"spc", nil]; return @[@"ay", @"gbs", @"hes", @"kss", @"nsf", @"nsfe", @"sap", @"sfm", @"sgc", @"spc"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
@ -229,7 +229,7 @@ gme_err_t readCallback( void* data, void* out, long count )
[ret addObject:@"vg.icns"]; [ret addObject:@"vg.icns"];
[ret addObjectsFromArray:[self fileTypes]]; [ret addObjectsFromArray:[self fileTypes]];
return [NSArray arrayWithObject:ret]; return @[ret];
} }

View File

@ -299,7 +299,7 @@ didCompleteWithError:(NSError *)error{
+ (NSArray *)schemes + (NSArray *)schemes
{ {
return [NSArray arrayWithObjects:@"http", @"https", nil]; return @[@"http", @"https"];
} }
@end @end

View File

@ -1739,12 +1739,12 @@ static int usf_info(void * context, const char * name, const char * value)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"psf",@"minipsf",@"psf2", @"minipsf2", @"ssf", @"minissf", @"dsf", @"minidsf", @"qsf", @"miniqsf", @"gsf", @"minigsf", @"ncsf", @"minincsf", @"2sf", @"mini2sf", @"usf", @"miniusf", nil]; return @[@"psf",@"minipsf",@"psf2", @"minipsf2", @"ssf", @"minissf", @"dsf", @"minidsf", @"qsf", @"miniqsf", @"gsf", @"minigsf", @"ncsf", @"minincsf", @"2sf", @"mini2sf", @"usf", @"miniusf"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-psf", nil]; return @[@"audio/x-psf"];
} }
+ (float)priority + (float)priority
@ -1759,7 +1759,7 @@ static int usf_info(void * context, const char * name, const char * value)
[ret addObject:@"vg.icns"]; [ret addObject:@"vg.icns"];
[ret addObjectsFromArray:[self fileTypes]]; [ret addObjectsFromArray:[self fileTypes]];
return [NSArray arrayWithObject:ret]; return @[[NSArray arrayWithArray:ret]];
} }

View File

@ -191,7 +191,7 @@ static void oneTimeInit(void)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"hvl", @"ahx", nil]; return @[@"hvl", @"ahx"];
} }
+ (NSArray *)fileTypeAssociations + (NSArray *)fileTypeAssociations

View File

@ -14,12 +14,12 @@
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"m3u", @"m3u8", nil]; return @[@"m3u", @"m3u8"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-mpegurl", @"audio/mpegurl", nil]; return @[@"audio/x-mpegurl", @"audio/mpegurl"];
} }
+ (float)priority + (float)priority
@ -77,7 +77,7 @@
id<CogSource> source = [audioSourceClass audioSourceForURL:url]; id<CogSource> source = [audioSourceClass audioSourceForURL:url];
if (![source open:url]) if (![source open:url])
return [NSArray array]; return @[];
long size = 0; long size = 0;
long bytesread = 0; long bytesread = 0;
@ -121,7 +121,7 @@
free(filecontents); free(filecontents);
if (!contents) { if (!contents) {
ALog(@"Could not open file...%@ %@", url, contents); ALog(@"Could not open file...%@ %@", url, contents);
return [NSArray array]; return @[];
} }
NSMutableArray *entries = [NSMutableArray array]; NSMutableArray *entries = [NSMutableArray array];

View File

@ -40,10 +40,10 @@
id<CogSource> source = [audioSourceClass audioSourceForURL:url]; id<CogSource> source = [audioSourceClass audioSourceForURL:url];
if (![source open:url]) if (![source open:url])
return [NSArray array]; return @[];
if (![source seekable]) if (![source seekable])
return [NSArray array]; return @[];
[source seek:0 whence:SEEK_END]; [source seek:0 whence:SEEK_END];
long size = [source tell]; long size = [source tell];
@ -56,7 +56,7 @@
size_t track_count = 0; size_t track_count = 0;
if ( !midi_processor::process_track_count( data, [[url pathExtension] UTF8String], track_count) ) if ( !midi_processor::process_track_count( data, [[url pathExtension] UTF8String], track_count) )
return [NSArray array]; return @[];
NSMutableArray *tracks = [NSMutableArray array]; NSMutableArray *tracks = [NSMutableArray array];

View File

@ -125,7 +125,7 @@ static OSType getOSType(const char * in_)
if ( [[source url] isFileURL] ) if ( [[source url] isFileURL] )
{ {
// Let's check for a SoundFont // Let's check for a SoundFont
NSArray * extensions = [NSArray arrayWithObjects:@"sflist", @"sf2pack", @"sf2", nil]; NSArray * extensions = @[@"sflist", @"sf2pack", @"sf2"];
NSString * filePath = [[source url] path]; NSString * filePath = [[source url] path];
NSString * fileNameBase = [filePath lastPathComponent]; NSString * fileNameBase = [filePath lastPathComponent];
filePath = [filePath stringByDeletingLastPathComponent]; filePath = [filePath stringByDeletingLastPathComponent];
@ -355,12 +355,12 @@ static OSType getOSType(const char * in_)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"mid", @"midi", @"kar", @"rmi", @"mids", @"mds", @"hmi", @"hmp", @"hmq", @"mus", @"xmi", @"lds", nil]; return @[@"mid", @"midi", @"kar", @"rmi", @"mids", @"mds", @"hmi", @"hmp", @"hmq", @"mus", @"xmi", @"lds"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/midi", @"audio/x-midi", nil]; return @[@"audio/midi", @"audio/x-midi"];
} }
+ (float)priority + (float)priority

View File

@ -66,7 +66,7 @@
midi_meta_data_item item; midi_meta_data_item item;
bool remap_display_name = !metadata.get_item( "title", item ); bool remap_display_name = !metadata.get_item( "title", item );
NSArray * allowedKeys = [NSArray arrayWithObjects:@"title", @"artist", @"album", @"year", nil]; NSArray * allowedKeys = @[@"title", @"artist", @"album", @"year"];
NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity:10]; NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity:10];

View File

@ -220,12 +220,12 @@ mpc_bool_t CanSeekProc(mpc_reader *p_reader)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObject:@"mpc"]; return @[@"mpc"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-musepack", nil]; return @[@"audio/x-musepack"];
} }
+ (float)priority + (float)priority

View File

@ -180,12 +180,12 @@ static void g_push_archive_extensions(std::vector<std::string> & list)
[array addObject:[NSString stringWithUTF8String:ext->c_str()]]; [array addObject:[NSString stringWithUTF8String:ext->c_str()]];
} }
return array; return [NSArray arrayWithArray:array];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-it", @"audio/x-xm", @"audio/x-s3m", @"audio/x-mod", nil]; return @[@"audio/x-it", @"audio/x-xm", @"audio/x-s3m", @"audio/x-mod"];
} }
+ (float)priority + (float)priority
@ -200,7 +200,7 @@ static void g_push_archive_extensions(std::vector<std::string> & list)
[ret addObject:@"song.icns"]; [ret addObject:@"song.icns"];
[ret addObjectsFromArray:[self fileTypes]]; [ret addObjectsFromArray:[self fileTypes]];
return [NSArray arrayWithObject:ret]; return @[[NSArray arrayWithArray:ret]];
} }
@end @end

View File

@ -172,12 +172,12 @@ static void g_push_archive_extensions(std::vector<std::string> & list)
[array addObject:[NSString stringWithUTF8String:ext->c_str()]]; [array addObject:[NSString stringWithUTF8String:ext->c_str()]];
} }
return array; return [NSArray arrayWithArray:array];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-it", @"audio/x-xm", @"audio/x-s3m", @"audio/x-mod", nil]; return @[@"audio/x-it", @"audio/x-xm", @"audio/x-s3m", @"audio/x-mod"];
} }
+ (float)priority + (float)priority
@ -192,7 +192,7 @@ static void g_push_archive_extensions(std::vector<std::string> & list)
[ret addObject:@"song.icns"]; [ret addObject:@"song.icns"];
[ret addObjectsFromArray:[self fileTypes]]; [ret addObjectsFromArray:[self fileTypes]];
return [NSArray arrayWithObject:ret]; return @[[NSArray arrayWithArray:ret]];
} }
@end @end

View File

@ -175,12 +175,12 @@ opus_int64 sourceTell(void *_stream)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"opus",@"ogg",nil]; return @[@"opus",@"ogg"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-opus+ogg", @"application/ogg", nil]; return @[@"audio/x-opus+ogg", @"application/ogg"];
} }
+ (float)priority + (float)priority

View File

@ -14,12 +14,12 @@
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObject:@"pls"]; return @[@"pls"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-scpls", @"application/pls", nil]; return @[@"audio/x-scpls", @"application/pls"];
} }
+ (float)priority + (float)priority
@ -79,7 +79,7 @@
id<CogSource> source = [audioSourceClass audioSourceForURL:url]; id<CogSource> source = [audioSourceClass audioSourceForURL:url];
if (![source open:url]) if (![source open:url])
return [NSArray array]; return @[];
long size = 0; long size = 0;
long bytesread = 0; long bytesread = 0;
@ -123,7 +123,7 @@
free(filecontents); free(filecontents);
if (!contents) { if (!contents) {
ALog(@"Could not open file...%@ %@", url, contents); ALog(@"Could not open file...%@ %@", url, contents);
return [NSArray array]; return @[];
} }
NSMutableArray *entries = [NSMutableArray array]; NSMutableArray *entries = [NSMutableArray array];

View File

@ -100,12 +100,12 @@
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObject:@"shn"]; return @[@"shn"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"application/x-shorten", nil]; //This is basically useless, since we cant stream shorten yet return @[@"application/x-shorten"]; //This is basically useless, since we cant stream shorten yet
} }
+ (float)priority + (float)priority

View File

@ -92,12 +92,12 @@ enum { channels = 2 };
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray array]; return @[];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObject:@"audio/x-silence"]; return @[@"audio/x-silence"];
} }
+ (float)priority + (float)priority

View File

@ -61,7 +61,7 @@
+ (NSArray *)schemes + (NSArray *)schemes
{ {
return [NSArray arrayWithObject:@"silence"]; return @[@"silence"];
} }
- (void)dealloc { - (void)dealloc {

View File

@ -228,18 +228,18 @@
+ (NSArray *)coverNames + (NSArray *)coverNames
{ {
return [NSArray arrayWithObjects:@"cover", @"folder", @"album", @"front", nil]; return @[@"cover", @"folder", @"album", @"front"];
} }
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
//May be a way to get a list of supported formats //May be a way to get a list of supported formats
return [NSArray arrayWithObjects:@"ape", @"asf", @"wma", @"ogg", @"opus", @"mpc", @"flac", @"m4a", @"mp3", @"tak", @"ac3", @"apl", @"dts", @"dtshd", @"tta", @"wav", @"aif", @"aiff", @"wv", @"wvp", nil]; return @[@"ape", @"asf", @"wma", @"ogg", @"opus", @"mpc", @"flac", @"m4a", @"mp3", @"tak", @"ac3", @"apl", @"dts", @"dtshd", @"tta", @"wav", @"aif", @"aiff", @"wv", @"wvp"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-ape", @"audio/x-ms-wma", @"application/ogg", @"application/x-ogg", @"audio/x-vorbis+ogg", @"audio/x-musepack", @"audio/x-flac", @"audio/x-m4a", @"audio/mpeg", @"audio/x-mp3", @"audio/x-tak", @"audio/x-ac3", @"audio/x-apl", @"audio/x-dts", @"audio/x-dtshd", @"audio/x-tta", @"audio/wav", @"audio/aiff", @"audio/x-wavpack", nil]; return @[@"audio/x-ape", @"audio/x-ms-wma", @"application/ogg", @"application/x-ogg", @"audio/x-vorbis+ogg", @"audio/x-musepack", @"audio/x-flac", @"audio/x-m4a", @"audio/mpeg", @"audio/x-mp3", @"audio/x-tak", @"audio/x-ac3", @"audio/x-apl", @"audio/x-dts", @"audio/x-dtshd", @"audio/x-tta", @"audio/wav", @"audio/aiff", @"audio/x-wavpack"];
} }
+ (float)priority + (float)priority

View File

@ -42,8 +42,8 @@
/* /*
NSArray *keys = [NSArray arrayWithObjects:@"key1", @"key2", @"key3", nil]; NSArray *keys = @[@"key1", @"key2", @"key3"];
NSArray *objects = [NSArray arrayWithObjects:@"value1", @"value2", @"value3", nil]; NSArray *objects = @[@"value1", @"value2", @"value3"];
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys]; NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
for (id key in dictionary) for (id key in dictionary)

View File

@ -167,12 +167,12 @@ long sourceTell(void *datasource)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"ogg",nil]; return @[@"ogg"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"application/ogg", @"application/x-ogg", @"audio/x-vorbis+ogg", nil]; return @[@"application/ogg", @"application/x-ogg", @"audio/x-vorbis+ogg"];
} }
+ (float)priority + (float)priority

View File

@ -318,12 +318,12 @@ int32_t WriteBytesProc(void *ds, void *data, int32_t bcount)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"wv", @"wvp", nil]; return @[@"wv", @"wvp"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/x-wavpack", nil]; return @[@"audio/x-wavpack"];
} }
+ (float)priority + (float)priority

View File

@ -15,9 +15,9 @@
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"s98", @"dro", @"gym", return @[@"s98", @"dro", @"gym",
@"vgm",@"vgz", // These are included so they can override AdPlug @"vgm",@"vgz" // These are included so they can override AdPlug and VGMStream
nil]; ];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
@ -39,7 +39,7 @@
} }
// None of the covered formats include subsongs, but dodge VGMStream and AdPlug // None of the covered formats include subsongs, but dodge VGMStream and AdPlug
return [NSArray arrayWithObject:[NSURL URLWithString:[[url absoluteString] stringByAppendingString:@"#0"]]]; return @[[NSURL URLWithString:[[url absoluteString] stringByAppendingString:@"#0"]]];
} }
@end @end

View File

@ -278,7 +278,7 @@ const int masterVol = 0x10000; // Fixed point 16.16
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"vgm", @"vgz", @"s98", @"dro", @"gym", nil]; return @[@"vgm", @"vgz", @"s98", @"dro", @"gym"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
@ -298,7 +298,7 @@ const int masterVol = 0x10000; // Fixed point 16.16
[ret addObject:@"vg.icns"]; [ret addObject:@"vg.icns"];
[ret addObjectsFromArray:[self fileTypes]]; [ret addObjectsFromArray:[self fileTypes]];
return [NSArray arrayWithObject:ret]; return @[[NSArray arrayWithArray:ret]];
} }
- (void)setSource:(id<CogSource>)s - (void)setSource:(id<CogSource>)s

View File

@ -361,7 +361,7 @@ static void sidTuneLoader(const char* fileName, std::vector<uint8_t>& bufferRef)
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
return [NSArray arrayWithObjects:@"sid", @"mus", nil]; return @[@"sid", @"mus"];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes

View File

@ -56,7 +56,7 @@
if (!stream) if (!stream)
{ {
ALog(@"Open failed for file: %@", [url absoluteString]); ALog(@"Open failed for file: %@", [url absoluteString]);
return [NSArray array]; return @[];
} }
VGMInfoCache * sharedMyCache = [VGMInfoCache sharedCache]; VGMInfoCache * sharedMyCache = [VGMInfoCache sharedCache];
@ -81,7 +81,7 @@
stream = init_vgmstream_from_cogfile([path UTF8String], i); stream = init_vgmstream_from_cogfile([path UTF8String], i);
if (!stream) if (!stream)
return [NSArray array]; return @[];
trackurl = [NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:@"#%i", i]]; trackurl = [NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:@"#%i", i]];
[sharedMyCache stuffURL:trackurl stream:stream]; [sharedMyCache stuffURL:trackurl stream:stream];

View File

@ -403,7 +403,7 @@ static NSString* get_description_tag(const char* description, const char *tag, c
[array addObject:[NSString stringWithUTF8String:formats[i]]]; [array addObject:[NSString stringWithUTF8String:formats[i]]];
} }
return array; return [NSArray arrayWithArray:array];
} }
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
@ -423,7 +423,7 @@ static NSString* get_description_tag(const char* description, const char *tag, c
[ret addObject:@"vg.icns"]; [ret addObject:@"vg.icns"];
[ret addObjectsFromArray:[self fileTypes]]; [ret addObjectsFromArray:[self fileTypes]];
return [NSArray arrayWithObject:ret]; return @[[NSArray arrayWithArray:ret]];
} }
@end @end

View File

@ -32,7 +32,7 @@
if (defaultDevice && defaultDeviceID != -1) { if (defaultDevice && defaultDeviceID != -1) {
if ((deviceID == defaultDeviceID) || if ((deviceID == defaultDeviceID) ||
([deviceName isEqualToString:defaultDeviceName])) { ([deviceName isEqualToString:defaultDeviceName])) {
[self setSelectedObjects:[NSArray arrayWithObject:deviceInfo]]; [self setSelectedObjects:@[deviceInfo]];
// Update `outputDevice`, in case the ID has changed. // Update `outputDevice`, in case the ID has changed.
[[NSUserDefaults standardUserDefaults] setObject:deviceInfo forKey:@"outputDevice"]; [[NSUserDefaults standardUserDefaults] setObject:deviceInfo forKey:@"outputDevice"];
} }

View File

@ -32,7 +32,7 @@
{ {
data = [NSArchiver archivedDataWithRootObject:urls]; data = [NSArchiver archivedDataWithRootObject:urls];
} }
[pboard declareTypes:[NSArray arrayWithObjects:CogUrlsPboardType,nil] owner:nil]; //add it to pboard [pboard declareTypes:@[CogUrlsPboardType] owner:nil]; //add it to pboard
[pboard setData:data forType:CogUrlsPboardType]; [pboard setData:data forType:CogUrlsPboardType];
[spotlightWindowController.query enableUpdates]; [spotlightWindowController.query enableUpdates];

View File

@ -19,15 +19,15 @@ static NSDictionary *importKeys;
{ {
// We need to translate the path string to a full URL // We need to translate the path string to a full URL
NSArray *URLTransform = NSArray *URLTransform =
[NSArray arrayWithObjects:@"URL", @"PathToURLTransformer", nil]; @[@"URL", @"PathToURLTransformer"];
// Extract the artist name from the authors array // Extract the artist name from the authors array
NSArray *artistTransform = NSArray *artistTransform =
[NSArray arrayWithObjects:@"artist", @"AuthorToArtistTransformer", nil]; @[@"artist", @"AuthorToArtistTransformer"];
// Track numbers must sometimes be converted from NSNumber to NSString // Track numbers must sometimes be converted from NSNumber to NSString
NSArray *trackTransform = NSArray *trackTransform =
[NSArray arrayWithObjects:@"spotlightTrack", @"NumberToStringTransformer", nil]; @[@"spotlightTrack", @"NumberToStringTransformer"];
importKeys = [NSDictionary dictionaryWithObjectsAndKeys: importKeys = [NSDictionary dictionaryWithObjectsAndKeys:
@"title", @"kMDItemTitle", @"title", @"kMDItemTitle",
@ -91,4 +91,4 @@ static NSDictionary *importKeys;
@synthesize length; @synthesize length;
@synthesize spotlightTrack; @synthesize spotlightTrack;
@end @end

View File

@ -80,7 +80,7 @@ static SpotlightWindowController * searchController;
if (value == nil) return nil; if (value == nil) return nil;
NSURL *scope = [NSURL URLWithString:value]; NSURL *scope = [NSURL URLWithString:value];
return [NSArray arrayWithObject: scope]; return @[scope];
} }
@end @end

View File

@ -62,7 +62,7 @@ static NSPredicate * musicOnlyPredicate = nil;
if (self = [super initWithWindowNibName:@"SpotlightPanel"]) { if (self = [super initWithWindowNibName:@"SpotlightPanel"]) {
self.query = [[NSMetadataQuery alloc]init]; self.query = [[NSMetadataQuery alloc]init];
[self.query setDelegate:self]; [self.query setDelegate:self];
self.query.sortDescriptors = [NSArray arrayWithObjects: self.query.sortDescriptors = @[
[[NSSortDescriptor alloc]initWithKey:@"kMDItemAuthors" [[NSSortDescriptor alloc]initWithKey:@"kMDItemAuthors"
ascending:YES ascending:YES
selector:@selector(compareFirstString:)], selector:@selector(compareFirstString:)],
@ -71,8 +71,8 @@ static NSPredicate * musicOnlyPredicate = nil;
selector:@selector(caseInsensitiveCompare:)], selector:@selector(caseInsensitiveCompare:)],
[[NSSortDescriptor alloc]initWithKey:@"kMDItemAudioTrackNumber" [[NSSortDescriptor alloc]initWithKey:@"kMDItemAudioTrackNumber"
ascending:YES ascending:YES
selector:@selector(compareTrackNumbers:)], selector:@selector(compareTrackNumbers:)]
nil]; ];
// hook my query transformer up to me // hook my query transformer up to me
[PausingQueryTransformer setSearchController:self]; [PausingQueryTransformer setSearchController:self];
@ -116,19 +116,18 @@ static NSPredicate * musicOnlyPredicate = nil;
// musicOnlyPredicate // musicOnlyPredicate
NSPredicate *spotlightPredicate = [NSCompoundPredicate andPredicateWithSubpredicates: NSPredicate *spotlightPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:
[NSArray arrayWithObjects: musicOnlyPredicate, @[musicOnlyPredicate,
searchPredicate, searchPredicate]];
nil]];
// Only preform a new search if the predicate has changed or there is a new path // Only preform a new search if the predicate has changed or there is a new path
if(![self.query.predicate isEqual:spotlightPredicate] if(![self.query.predicate isEqual:spotlightPredicate]
|| ![self.query.searchScopes isEqualToArray: || ![self.query.searchScopes isEqualToArray:
[NSArray arrayWithObjects:pathControl.URL, nil]]) @[pathControl.URL]])
{ {
if([self.query isStarted]) if([self.query isStarted])
[self.query stopQuery]; [self.query stopQuery];
self.query.predicate = spotlightPredicate; self.query.predicate = spotlightPredicate;
// Set scope to contents of pathControl // Set scope to contents of pathControl
self.query.searchScopes = [NSArray arrayWithObjects:pathControl.URL, nil]; self.query.searchScopes = @[pathControl.URL];
[self.query startQuery]; [self.query startQuery];
DLog(@"Started query: %@", [self.query.predicate description]); DLog(@"Started query: %@", [self.query.predicate description]);
} }

View File

@ -37,7 +37,7 @@
NSUInteger i; NSUInteger i;
for (i = 0; i < minCount; ++i) for (i = 0; i < minCount; ++i)
{ {
NSArray* p = [NSArray arrayWithObjects:[x objectAtIndex:i], [y objectAtIndex:i], nil]; NSArray* p = @[[x objectAtIndex:i], [y objectAtIndex:i]];
[pairs addObject:p]; [pairs addObject:p];
} }
@ -55,7 +55,7 @@
[second addObject:[pair second]]; [second addObject:[pair second]];
} }
return [NSArray arrayWithObjects:first,second,nil]; return @[first,second];
} }
@ -78,4 +78,4 @@
} }
@end @end

View File

@ -18,7 +18,7 @@ NSString * getDatabasePath(void)
NSArray * createSchema(void) NSArray * createSchema(void)
{ {
return [NSArray arrayWithObjects: return @[
@"CREATE TABLE IF NOT EXISTS stringdictionary ( \ @"CREATE TABLE IF NOT EXISTS stringdictionary ( \
stringid INTEGER PRIMARY KEY AUTOINCREMENT, \ stringid INTEGER PRIMARY KEY AUTOINCREMENT, \
referencecount INTEGER, \ referencecount INTEGER, \
@ -67,7 +67,7 @@ NSArray * createSchema(void)
queueid INTEGER PRIMARY KEY AUTOINCREMENT, \ queueid INTEGER PRIMARY KEY AUTOINCREMENT, \
queueindex INTEGER, \ queueindex INTEGER, \
entryid INTEGER \ entryid INTEGER \
);", nil );"
]; ];
} }

View File

@ -92,10 +92,10 @@
- (void)showSideView - (void)showSideView
{ {
if ([splitView isVertical]) { if ([splitView isVertical]) {
[splitView setSubviews:[NSArray arrayWithObjects:[self view], mainView, nil]]; [splitView setSubviews:@[[self view], mainView]];
} }
else { else {
[splitView setSubviews:[NSArray arrayWithObjects:mainView, [self view], nil]]; [splitView setSubviews:@[mainView, [self view]]];
} }
[self setDividerPosition: [[NSUserDefaults standardUserDefaults] floatForKey:[self sideViewDividerPositionDefaultsKey]]]; [self setDividerPosition: [[NSUserDefaults standardUserDefaults] floatForKey:[self sideViewDividerPositionDefaultsKey]]];
@ -107,7 +107,7 @@
- (void)hideSideView - (void)hideSideView
{ {
[splitView setSubviews:[NSArray arrayWithObject:mainView]]; [splitView setSubviews:@[mainView]];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:[self showSideViewDefaultsKey]]; [[NSUserDefaults standardUserDefaults] setBool:NO forKey:[self showSideViewDefaultsKey]];
[[mainView window] makeFirstResponder:mainView]; [[mainView window] makeFirstResponder:mainView];

View File

@ -483,7 +483,7 @@ void equalizerApplyPreset(AudioUnit au, NSDictionary * preset) {
splitView = [[NSSplitView alloc] initWithFrame:topRect]; splitView = [[NSSplitView alloc] initWithFrame:topRect];
[splitView setSubviews:[NSArray arrayWithObjects:topView, auView, nil]]; [splitView setSubviews:@[topView, auView]];
[self setContentView:splitView]; [self setContentView:splitView];