Type references to the application delegate to prevent warnings.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Tue, 26 Feb 2013 16:45:38 +0000 (17:45 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Tue, 26 Feb 2013 16:45:38 +0000 (17:45 +0100)
ConfigsController.m
JoystickController.m
TargetConfig.m

index 43c92d3..01bd0d3 100644 (file)
@@ -48,7 +48,7 @@
        currentConfig = config;
        [removeButton setEnabled: ![config protect]];
        [targetController load];
-       [[[NSApplication sharedApplication] delegate] configChanged];
+       [(ApplicationController *)[[NSApplication sharedApplication] delegate] configChanged];
        [tableView selectRow: [configs indexOfObject: config] byExtendingSelection: NO];
 }
 
@@ -56,7 +56,7 @@
        Config* newConfig = [[Config alloc] init];
        [newConfig setName: @"untitled"];
        [configs addObject: newConfig];
-       [[[NSApplication sharedApplication] delegate] configsChanged];
+       [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged];
        [tableView reloadData];
        [tableView selectRow: ([configs count]-1) byExtendingSelection: NO];
        [tableView editColumn: 0 row:([configs count]-1) withEvent:nil select:YES];
@@ -78,7 +78,7 @@
                                [entries removeObjectForKey: key];
                }
        }
-       [[[NSApplication sharedApplication] delegate] configsChanged];
+       [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged];
        
        [tableView reloadData];
 }
@@ -99,7 +99,7 @@
        [(Config*)[configs objectAtIndex: index] setName: newName];
        [targetController refreshConfigsPreservingSelection:YES];
        [tableView reloadData];
-       [[[NSApplication sharedApplication] delegate] configsChanged];
+       [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged];
 }
 
 -(int)numberOfRowsInTableView: (NSTableView*)table {
        configs = newConfigs;
        [tableView reloadData];
        currentConfig = NULL;
-       [[[NSApplication sharedApplication] delegate] configsChanged];
+       [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged];
        
        int index = [[envelope objectForKey: @"selectedIndex"] intValue];
        [self activateConfig: [configs objectAtIndex:index] forApplication: NULL];
index 1551295..1bf5b43 100644 (file)
@@ -65,7 +65,7 @@ void input_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDVal
        IOHIDDeviceRef device = IOHIDQueueGetDevice((IOHIDQueueRef) inSender);
        
        Joystick* js = [self findJoystickByRef: device];
-       if([[[NSApplication sharedApplication] delegate] active]) {
+       if([(ApplicationController *)[[NSApplication sharedApplication] delegate] active]) {
                // for reals
                JSAction* mainAction = [js actionForEvent: value];
                if(!mainAction)
index 73d4563..dae7786 100644 (file)
@@ -30,7 +30,7 @@
 }
 
 -(void) trigger {
-       [[[[NSApplication sharedApplication] delegate] configsController] activateConfig:config forApplication: NULL];
+       [[(ApplicationController *)[[NSApplication sharedApplication] delegate] configsController] activateConfig:config forApplication: NULL];
 }
 
 @end