Remove hardcoded menu item offsets. Remove unused property.
[enjoyable.git] / ConfigsController.m
index 3168f8d..63211ae 100644 (file)
@@ -26,6 +26,9 @@
        [self activateConfig: neutralConfig forApplication: NULL];
 }
 
+// TODO: Not an appropriate way to track 'neutral configs', it should just
+// always be the first config and be unremovable.
+
 -(void) activateConfig: (Config*)config forApplication: (ProcessSerialNumber*) psn {
        if(currentConfig == config)
                return;
@@ -33,7 +36,6 @@
        if(psn) {
                if(!neutralConfig)
                        neutralConfig = currentConfig;
-               attachedApplication = *psn;
        } else {
                neutralConfig = NULL;
        }
                [ary addObject: cfgInfo];
        }
        envelope[@"configurationList"] = ary;
-       envelope[@"selectedIndex"] = [NSNumber numberWithInt: [configs indexOfObject: [self currentNeutralConfig] ] ];
+       envelope[@"selectedIndex"] = @([configs indexOfObject: [self currentNeutralConfig] ]);
        return envelope;
 }
 -(void) loadAllFrom: (NSDictionary*) envelope{
        [self restoreNeutralConfig];
 }
 
--(ProcessSerialNumber*) targetApplication {
-       if(neutralConfig)
-               return &attachedApplication;
-       return NULL;
-}
-
 @end