Rename 'stringify' to 'uid' where it pertains to unique action IDs.
[enjoyable.git] / ConfigsController.m
index cc16b6e..58614b2 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;
        }
        [configs removeObjectAtIndex: [tableView selectedRow]];
        
        // remove all "switch to configuration" actions
-       for(int i=0; i<[configs count]; i++) {
-               NSMutableDictionary* entries = [(Config*)configs[i] entries];
-               for(id key in entries) {
-                       Target* target = (Target*) entries[key];
-                       if([target isKindOfClass: [TargetConfig class]] && [(TargetConfig*)target config] == current_config)
+    for (Config *config in configs) {
+               NSMutableDictionary *entries = config.entries;
+               for (id key in entries) {
+                       Target *target = entries[key];
+                       if([target isKindOfClass:[TargetConfig class]] && [(TargetConfig *)target config] == current_config)
                                [entries removeObjectForKey: key];
                }
        }
        [self restoreNeutralConfig];
 }
 
--(ProcessSerialNumber*) targetApplication {
-       if(neutralConfig)
-               return &attachedApplication;
-       return NULL;
-}
-
 @end