diff --git a/Resources/Info.plist b/Resources/Info.plist index 11f626e..399ee0f 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -29,13 +29,9 @@ LSMinimumSystemVersionByArchitecture i386 - 10.4 - ppc - 10.4 - ppc64 - 10.5 + 10.9 x86_64 - 10.6 + 10.9 LSUIElement 1 diff --git a/Source/AppController.m b/Source/AppController.m index e3cf2f7..ee2762c 100644 --- a/Source/AppController.m +++ b/Source/AppController.m @@ -110,9 +110,8 @@ - (void) awakeFromNib [CDOptions printOpts:[allKeys allKeys] forRunMode:runMode]; } // Add any extras chooseControl came up with - NSEnumerator *en = [extraOptions keyEnumerator]; - NSString *key; - while ((key = [en nextObject])) { + for (NSString *key in extraOptions) + { [options setOption:extraOptions[key] forKey:key]; } diff --git a/Source/CDControl/CDControl.m b/Source/CDControl/CDControl.m index 4bcecd6..aaa9cc0 100644 --- a/Source/CDControl/CDControl.m +++ b/Source/CDControl/CDControl.m @@ -166,7 +166,7 @@ + (void) printHelpTo:(NSFileHandle *)fh { } currKey++; } - + [fh writeData:[@"\n\tGlobal Options:\n\t\t--help, --debug, --title, --width, --height,\n\t\t--string-output, --no-newline\n\nSee http://mstratman.github.com/cocoadialog/#documentation\nfor detailed documentation.\n" dataUsingEncoding:NSUTF8StringEncoding]]; } } diff --git a/Source/CDControl/CDFileDialogControl/CDFileDialogControl.m b/Source/CDControl/CDFileDialogControl/CDFileDialogControl.m index 28f4ee8..cf9cd6f 100644 --- a/Source/CDControl/CDFileDialogControl/CDFileDialogControl.m +++ b/Source/CDControl/CDFileDialogControl/CDFileDialogControl.m @@ -78,15 +78,16 @@ - (void) setMisc { NSArray *optionExtensions = [options optValues:@"with-extensions"]; if (optionExtensions && [optionExtensions count]) { NSString *extension; - NSEnumerator *en = [optionExtensions objectEnumerator]; - while ((extension = [en nextObject])) { - if ([extension isEqualToString:@"."]) { + for (extension in optionExtensions) + { + if ([extension isEqualToString:@"."]) + { extension = @""; } // Strip leading '.' from each extension else if ([extension length] > 1 && [[extension substringWithRange:NSMakeRange(0,1)] isEqualToString:@"."]) { - extension = [extension substringFromIndex:1]; - } + extension = [extension substringFromIndex:1]; + } [extensions addObject:extension]; } } diff --git a/Source/CDControl/CDFileDialogControl/CDFileSelectControl.m b/Source/CDControl/CDFileDialogControl/CDFileSelectControl.m index c337524..e56c686 100644 --- a/Source/CDControl/CDFileDialogControl/CDFileSelectControl.m +++ b/Source/CDControl/CDFileDialogControl/CDFileSelectControl.m @@ -126,13 +126,13 @@ - (void) createControl { if (result == NSFileHandlingPanelOKButton) { controlExitStatus = -1; - NSEnumerator *en = [[openPanel URLs] objectEnumerator]; - id key; - while ((key = [en nextObject])) { + for (id key in [openPanel URLs]) + { [controlReturnValues addObject:[key path]]; } } - else { + else + { controlExitStatus = -2; controlReturnValues = [NSMutableArray array]; } diff --git a/Source/CDControl/CDIcon.m b/Source/CDControl/CDIcon.m index af38024..058a7d2 100644 --- a/Source/CDControl/CDIcon.m +++ b/Source/CDControl/CDIcon.m @@ -430,17 +430,16 @@ - (void) setIconWithImage:(NSImage *)anImage withSize:(NSSize)aSize withControls [self setIconWithImage:anImage withSize:aSize]; float iconWidthDiff = [control frame].size.width - iconFrame.size.width; - NSEnumerator *en = [anArray objectEnumerator]; - id _control; - while ((_control = [en nextObject])) { - // Make sure the control exists + + for (id _control in anArray) + { if (_control) { NSRect controlFrame = [_control frame]; NSRect newControlFrame = NSMakeRect(controlFrame.origin.x + iconWidthDiff, controlFrame.origin.y, controlFrame.size.width - iconWidthDiff, controlFrame.size.height); [_control setFrame:newControlFrame]; } } - + } // Icon does not have image else { @@ -450,10 +449,11 @@ - (void) setIconWithImage:(NSImage *)anImage withSize:(NSSize)aSize withControls [control removeFromSuperview]; control = nil; // Move the controls to the left and increase their width - NSEnumerator *en = [anArray objectEnumerator]; + id _control; - while ((_control = [en nextObject])) { - // Make sure the control exists + + for (_control in anArray) + { if (_control) { NSRect controlFrame = [_control frame]; float newControlWidth = controlFrame.size.width + (controlFrame.origin.x - iconFrame.origin.x); diff --git a/Source/CDControl/CDNotifyControl/CDBubbleControl.m b/Source/CDControl/CDNotifyControl/CDBubbleControl.m index 9d4d58e..d5fa7ac 100644 --- a/Source/CDControl/CDNotifyControl/CDBubbleControl.m +++ b/Source/CDControl/CDNotifyControl/CDBubbleControl.m @@ -153,30 +153,30 @@ - (void) createControl { clickArg:clickArg ]; } - - NSEnumerator *en = [notifications objectEnumerator]; - id obj; - int i = 0; - while ((obj = [en nextObject])) { - NSDictionary * notification = [NSDictionary dictionaryWithDictionary:obj]; + NSUInteger index = 0; + for (id object in notifications) + { + NSDictionary * notification = [NSDictionary dictionaryWithDictionary:object]; KABubbleWindowController *bubble = [KABubbleWindowController bubbleWithTitle:notification[@"title"] text:notification[@"description"] icon:notification[@"icon"] timeout:_timeout - lightColor:[self _colorForBubble:i fromKey:@"background-tops" alpha:alpha] - darkColor:[self _colorForBubble:i fromKey:@"background-bottoms" alpha:alpha] - textColor:[self _colorForBubble:i fromKey:@"text-colors" alpha:alpha] - borderColor:[self _colorForBubble:i fromKey:@"border-colors" alpha:alpha] + lightColor:[self _colorForBubble:index fromKey:@"background-tops" alpha:alpha] + darkColor:[self _colorForBubble:index fromKey:@"background-bottoms" alpha:alpha] + textColor:[self _colorForBubble:index fromKey:@"text-colors" alpha:alpha] + borderColor:[self _colorForBubble:index fromKey:@"border-colors" alpha:alpha] numExpectedBubbles:(unsigned)[notifications count] bubblePosition:position]; - + [bubble setAutomaticallyFadesOut:![notification[@"sticky"] boolValue]]; [bubble setDelegate:self]; [bubble setClickContext:[NSString stringWithFormat:@"%d", activeNotifications]]; [bubble startFadeIn]; activeNotifications++; - i++; + index++; } + + } - (void) debug:(NSString *)message diff --git a/Source/CDControl/CDNotifyControl/CDGrowlControl.m b/Source/CDControl/CDNotifyControl/CDGrowlControl.m index f62791f..eef61e3 100644 --- a/Source/CDControl/CDNotifyControl/CDGrowlControl.m +++ b/Source/CDControl/CDNotifyControl/CDGrowlControl.m @@ -125,11 +125,9 @@ - (void) createControl { clickArg:clickArg ]; } - - NSEnumerator *en = [notifications objectEnumerator]; - id obj; - while ((obj = [en nextObject])) { - NSDictionary * notification = [NSDictionary dictionaryWithDictionary:obj]; + for (id object in notifications) + { + NSDictionary * notification = [NSDictionary dictionaryWithDictionary:object]; [GrowlApplicationBridge notifyWithTitle:notification[@"title"] description:notification[@"description"] diff --git a/Source/CDControl/CDNotifyControl/CDNotifyControl.m b/Source/CDControl/CDNotifyControl/CDNotifyControl.m index 86a09bc..bd564a6 100644 --- a/Source/CDControl/CDNotifyControl/CDNotifyControl.m +++ b/Source/CDControl/CDNotifyControl/CDNotifyControl.m @@ -126,8 +126,8 @@ - (NSArray *) notificationIcons { [icons addObject:_icon]; } - } else if ([options hasOpt:@"icon-files"] - && [[options optValues:@"icon-files"] count]) + } + else if ([options hasOpt:@"icon-files"] && [[options optValues:@"icon-files"] count]) { iconArgs = [options optValues:@"icon-files"]; en = [iconArgs objectEnumerator]; @@ -184,10 +184,14 @@ - (NSArray *) parseTextForArguments:(NSString *)string string = [string stringByReplacingOccurrencesOfString:@"\"" withString:[NSString stringWithFormat: @"\n\"\n"]]; NSArray * quotedArray = [string componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; BOOL inQuote = NO; - NSEnumerator *en = [quotedArray objectEnumerator]; - id arg; - while ((arg = [en nextObject])) { - NSMutableArray* spacedArray = [NSMutableArray arrayWithArray:nil]; + + + __strong id arg; + + NSMutableArray* spacedArray = [NSMutableArray arrayWithArray:nil]; + + for (arg in quotedArray) + { // Determine which quote state we're in if ([[arg substringToIndex:1] isEqualToString:@"\""]) { inQuote = !inQuote; @@ -205,6 +209,7 @@ - (NSArray *) parseTextForArguments:(NSString *)string [masterArray addObjectsFromArray:spacedArray]; } } + return masterArray; } diff --git a/Source/CDControl/CDThreeButtonControl/CDCheckboxControl.m b/Source/CDControl/CDThreeButtonControl/CDCheckboxControl.m index 7c15ec7..1696a98 100644 --- a/Source/CDControl/CDThreeButtonControl/CDCheckboxControl.m +++ b/Source/CDControl/CDThreeButtonControl/CDCheckboxControl.m @@ -80,17 +80,22 @@ - (void) createControl { // set return values NSArray * cells = [controlMatrix cells]; NSMutableArray *tmpValues = [[NSMutableArray alloc] init]; - NSEnumerator *en = [cells objectEnumerator]; - id obj; - while ((obj = [en nextObject])) { - if ([[obj className] isEqualToString:@"NSButtonCell"]) { - [tmpValues addObject:obj]; + id object; + for (object in cells) + { + if ([[object className] isEqualToString:@"NSButtonCell"]) { + [tmpValues addObject:object]; } } + checkboxes = [NSMutableArray arrayWithArray:tmpValues]; - en = [tmpValues objectEnumerator]; - while (obj == [en nextObject]) { - checkboxes[[obj tag]] = obj; + for (object in tmpValues) + { + if (object) + { + checkboxes[[object tag]] = object; + } + } } @@ -185,43 +190,40 @@ - (void) setControl:(id)sender { NSMutableArray * controls = [[NSMutableArray alloc] init]; // Create the control for each item - unsigned long currItem = 0; - NSEnumerator *en = [items objectEnumerator]; float cellWidth = 0.0; - id obj; - while ((obj = [en nextObject])) { + + NSUInteger index = 0; + for (id object in items) + { NSButton * button = [[NSButton alloc] init]; [button setButtonType:NSSwitchButton]; - [button setTitle:items[currItem]]; + [button setTitle:items[index]]; if (checked && [checked count]) { - if ([checked containsObject:[NSString stringWithFormat:@"%lu", currItem]]) { + if ([checked containsObject:[NSString stringWithFormat:@"%lu", index]]) + { [[button cell] setState:NSOnState]; } } if (mixed && [mixed count]) { - if ([mixed containsObject:[NSString stringWithFormat:@"%lu", currItem]]) { + if ([mixed containsObject:[NSString stringWithFormat:@"%lu", index]]) + { [[button cell] setAllowsMixedState:YES]; [[button cell] setState:NSMixedState]; } } if (disabled && [disabled count]) { - if ([disabled containsObject:[NSString stringWithFormat:@"%lu", currItem]]) { + if ([disabled containsObject:[NSString stringWithFormat:@"%lu", index]]) + { [[button cell] setEnabled: NO]; } } - [[button cell] setTag:currItem]; + [[button cell] setTag:index]; [button sizeToFit]; if ([button frame].size.width > cellWidth) { cellWidth = [button frame].size.width; } [controls addObject:[button cell]]; - currItem++; } - - - - - // Set other attributes of matrix [controlMatrix setAutosizesCells:NO]; @@ -229,7 +231,7 @@ - (void) setControl:(id)sender { [controlMatrix setMode:NSHighlightModeMatrix]; // Populate the matrix - currItem = 0; + int currItem = 0; for (unsigned long currColumn = 0; currColumn <= columns - 1; currColumn++) { for (unsigned long currRow = 0; currRow <= rows - 1; currRow++) { if (currItem <= [items count] - 1) { diff --git a/Source/CDControl/CDThreeButtonControl/CDPopUpButtonControl.m b/Source/CDControl/CDThreeButtonControl/CDPopUpButtonControl.m index e90413b..b2c52b2 100644 --- a/Source/CDControl/CDThreeButtonControl/CDPopUpButtonControl.m +++ b/Source/CDControl/CDThreeButtonControl/CDPopUpButtonControl.m @@ -94,12 +94,13 @@ - (void) createControl { [popupControl setPullsDown:[options hasOpt:@"pulldown"] ? YES : NO]; // Populate menu NSArray *items = [NSArray arrayWithArray:[options optValues:@"items"]]; - if (items && [items count]) { - NSEnumerator *en = [items objectEnumerator]; - id obj; - while ((obj = [en nextObject])) { - [popupControl addItemWithTitle:(NSString *)obj]; - } + if (items && [items count]) + { + for (id object in items) + { + [popupControl addItemWithTitle:(NSString *)object]; + } + NSInteger selected = [options hasOpt:@"selected"] ? [[options optValue:@"selected"] integerValue] : 0; [popupControl selectItemAtIndex:selected]; } diff --git a/Source/CDControl/CDThreeButtonControl/CDRadioControl.m b/Source/CDControl/CDThreeButtonControl/CDRadioControl.m index 50f67bb..4d3a5a9 100644 --- a/Source/CDControl/CDThreeButtonControl/CDRadioControl.m +++ b/Source/CDControl/CDThreeButtonControl/CDRadioControl.m @@ -176,27 +176,27 @@ - (void) setControl:(id)sender { NSMutableArray * controls = [[NSMutableArray alloc] init]; // Create the control for each item - unsigned long currItem = 0; - NSEnumerator *en = [items objectEnumerator]; float cellWidth = 0.0; - id obj; - while ((obj = [en nextObject])) { + + NSUInteger index = 0; + for (id object in items) + { NSButton * button = [[NSButton alloc] init]; [button setButtonType:NSRadioButton]; - [button setTitle:items[currItem]]; + [button setTitle:items[index]]; if (disabled && [disabled count]) { - if ([disabled containsObject:[NSString stringWithFormat:@"%lu", currItem]]) { + if ([disabled containsObject:[NSString stringWithFormat:@"%lu", index]]) { [[button cell] setEnabled: NO]; } } - [[button cell] setTag:currItem]; + [[button cell] setTag:index]; [button sizeToFit]; if ([button frame].size.width > cellWidth) { cellWidth = [button frame].size.width; } [controls addObject:[button cell]]; - currItem++; } + // Set other attributes of matrix [controlMatrix setAutosizesCells:NO]; @@ -206,16 +206,16 @@ - (void) setControl:(id)sender { [controlMatrix setMode:NSRadioModeMatrix]; // Populate the matrix - currItem = 0; + int x = 0; for (unsigned long currColumn = 0; currColumn <= columns - 1; currColumn++) { for (unsigned long currRow = 0; currRow <= rows - 1; currRow++) { - if (currItem <= [items count] - 1) { - NSButtonCell * cell = controls[currItem]; + if (x <= [items count] - 1) { + NSButtonCell * cell = controls[x]; [controlMatrix putCell:cell atRow:currRow column:currColumn]; - if (selected == currItem) { + if (selected == x) { [controlMatrix selectCellAtRow:currRow column:currColumn]; } - currItem++; + x++; } else { NSCell * blankCell = [[NSCell alloc] init]; diff --git a/Source/CDOptions.m b/Source/CDOptions.m index 31ef9af..8c7f28f 100644 --- a/Source/CDOptions.m +++ b/Source/CDOptions.m @@ -156,8 +156,9 @@ + (void) printOpts:(NSArray *)availableOptions forRunMode:(NSString *)runMode - (BOOL) hasOpt:(NSString *)key { - return _options[key]; + return (BOOL)_options[key]; } + - (NSString *) optValue:(NSString *)key { id value = _options[key]; diff --git a/cocoaDialog.xcodeproj/project.pbxproj b/cocoaDialog.xcodeproj/project.pbxproj index 0bfca38..11e2803 100644 --- a/cocoaDialog.xcodeproj/project.pbxproj +++ b/cocoaDialog.xcodeproj/project.pbxproj @@ -688,7 +688,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = A78A8C9614375704007AE363 /* ConfigDebug.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -799,7 +798,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = A78A8C9714375704007AE363 /* ConfigRelease.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -817,7 +815,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = A78A8C9614375704007AE363 /* ConfigDebug.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; OTHER_CFLAGS = "-DDEBUG"; PRODUCT_NAME = relaunch; SDKROOT = macosx; @@ -828,7 +825,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = A78A8C9714375704007AE363 /* ConfigRelease.xcconfig */; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; PRODUCT_NAME = relaunch; SDKROOT = macosx; };