1212
1313@interface FilesQueue ()
1414
15- -(NSArray *)extensions ;
1615-(BOOL )isAnyQueueBusy ;
16+ @property (readonly , copy ) NSArray *extensions;
1717-(void )updateBusyState ;
1818@end
1919
@@ -51,7 +51,7 @@ -(void)configureWithTableView:(NSTableView *)inTableView {
5151}
5252
5353-(NSNumber *)queueCount {
54- return [ NSNumber numberWithInteger: cpuQueue.operationCount + dirWorkerQueue.operationCount + fileIOQueue.operationCount] ;
54+ return @( cpuQueue.operationCount + dirWorkerQueue.operationCount + fileIOQueue.operationCount ) ;
5555}
5656
5757-(BOOL )isAnyQueueBusy {
@@ -125,7 +125,7 @@ -(void)removeObjects:(NSArray *)objects {
125125- (NSString *)tableView : (NSTableView *)aTableView toolTipForCell : (NSCell *)aCell rect : (NSRectPointer )rect tableColumn : (NSTableColumn *)aTableColumn row : (int )row mouseLocation : (NSPoint )mouseLocation {
126126 NSArray *objs = [self arrangedObjects ];
127127 if (row < (signed )[objs count ]) {
128- File *f = [ objs objectAtIndex: row];
128+ File *f = objs[ row];
129129
130130 if ([aCell isKindOfClass: [RevealButtonCell class ]]) {
131131 NSRect infoButtonRect = [((RevealButtonCell *)aCell) infoButtonRectForBounds: *rect];
@@ -175,7 +175,7 @@ -(void) moveObjectsInArrangedObjectsFromIndexes:(NSIndexSet *)indexSet
175175 removeIndex = idx;
176176 insertIndex -= 1 ;
177177 }
178- object = [ objects objectAtIndex: removeIndex];
178+ object = objects[ removeIndex];
179179 [self removeObjectAtArrangedObjectIndex: removeIndex];
180180 [self insertObject: object atArrangedObjectIndex: insertIndex];
181181
@@ -380,7 +380,7 @@ -(void)startAgainOptimized:(BOOL)optimized {
380380 // UI doesn't give a way to deselect all, so here's a substitute
381381 // when selecting "again" on file that doesn't need it, deselect
382382 if (1 == selectionCount) {
383- File *file = [ files objectAtIndex: 0 ];
383+ File *file = files[ 0 ];
384384 if (file.isBusy || !file.isOptimized ) {
385385 files = [files copy ];
386386 [self setSelectedObjects: @[]];
@@ -459,7 +459,7 @@ -(NSArray *)extensions {
459459 [extensions addObject: @" PNG" ];
460460 }
461461 if (types & JPEG_ENABLED ) {
462- [extensions addObjectsFromArray: [ NSArray arrayWithObjects: @" jpg" ,@" JPG" ,@" jpeg" ,@" JPEG" , nil ]];
462+ [extensions addObjectsFromArray: @[ @" jpg" ,@" JPG" ,@" jpeg" ,@" JPEG" ]];
463463 }
464464 if (types & GIF_ENABLED ) {
465465 [extensions addObject: @" gif" ];
@@ -476,13 +476,13 @@ -(NSArray *)fileTypes {
476476 NSMutableArray *fileTypes = [NSMutableArray array ];
477477
478478 if (types & PNG_ENABLED ) {
479- [fileTypes addObjectsFromArray: [ NSArray arrayWithObjects: @" png" ,@" PNG" ,NSFileTypeForHFSTypeCode (' PNGf' ),@" public.png" ,@" image/png" , nil ]];
479+ [fileTypes addObjectsFromArray: @[ @" png" ,@" PNG" ,NSFileTypeForHFSTypeCode (' PNGf' ),@" public.png" ,@" image/png" ]];
480480 }
481481 if (types & JPEG_ENABLED ) {
482- [fileTypes addObjectsFromArray: [ NSArray arrayWithObjects: @" jpg" ,@" jpeg" ,@" JPG" ,@" JPEG" ,NSFileTypeForHFSTypeCode (' JPEG' ),@" public.jpeg" ,@" image/jpeg" , nil ]];
482+ [fileTypes addObjectsFromArray: @[ @" jpg" ,@" jpeg" ,@" JPG" ,@" JPEG" ,NSFileTypeForHFSTypeCode (' JPEG' ),@" public.jpeg" ,@" image/jpeg" ]];
483483 }
484484 if (types & GIF_ENABLED ) {
485- [fileTypes addObjectsFromArray: [ NSArray arrayWithObjects: @" gif" ,@" GIF" ,NSFileTypeForHFSTypeCode (' GIFf' ),@" public.gif" ,@" image/gif" , nil ]];
485+ [fileTypes addObjectsFromArray: @[ @" gif" ,@" GIF" ,NSFileTypeForHFSTypeCode (' GIFf' ),@" public.gif" ,@" image/gif" ]];
486486 }
487487 return fileTypes;
488488}
0 commit comments