X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=ApplicationController.m;h=4a4deeaeede3cde0d189299c9bd6f5f29aedda0c;hp=c87a6ee0ebff6f13e6a09f49ee21a5ef6032e979;hb=51ca12b552a9c17c4d4029b0340e193b273044a8;hpb=530009447c5bbd360ac5023979cffc6d32a28df3 diff --git a/ApplicationController.m b/ApplicationController.m index c87a6ee..4a4deea 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -42,9 +42,9 @@ pascal OSStatus appSwitch(EventHandlerCallRef handlerChain, EventRef event, void ApplicationController* self = (ApplicationController*)userData; NSDictionary* currentApp = [[NSWorkspace sharedWorkspace] activeApplication]; ProcessSerialNumber psn; - psn.lowLongOfPSN = [[currentApp objectForKey:@"NSApplicationProcessSerialNumberLow"] longValue]; - psn.highLongOfPSN = [[currentApp objectForKey:@"NSApplicationProcessSerialNumberHigh"] longValue]; - [self->configsController applicationSwitchedTo: [currentApp objectForKey:@"NSApplicationName"] withPsn: psn]; + psn.lowLongOfPSN = [currentApp[@"NSApplicationProcessSerialNumberLow"] longValue]; + psn.highLongOfPSN = [currentApp[@"NSApplicationProcessSerialNumberHigh"] longValue]; + [self->configsController applicationSwitchedTo: currentApp[@"NSApplicationName"] withPsn: psn]; return noErr; } @@ -76,10 +76,10 @@ pascal OSStatus appSwitch(EventHandlerCallRef handlerChain, EventRef event, void Config* current = [configsController currentConfig]; NSArray* configs = [configsController configs]; for(int i=0; i<[configs count]; i++) - [[dockMenuBase itemAtIndex: (2+i)] setState: (([configs objectAtIndex:i] == current) ? YES : NO)]; + [[dockMenuBase itemAtIndex: (2+i)] setState: ((configs[i] == current) ? YES : NO)]; } -(void) chooseConfig: (id) sender { - [configsController activateConfig: [[configsController configs] objectAtIndex: ([dockMenuBase indexOfItem: sender]-2)] forApplication: NULL]; + [configsController activateConfig: [configsController configs][([dockMenuBase indexOfItem: sender]-2)] forApplication: NULL]; } @end