From b0e48a152d139c0b9aeb1ee4a32ba24a4e3aa805 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Fri, 1 Mar 2013 18:41:58 +0100 Subject: [PATCH] Simplify config removal since it's always the active config removed. --- ConfigsController.m | 10 ++-------- TargetController.m | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/ConfigsController.m b/ConfigsController.m index a9f3f3e..d0d8401 100644 --- a/ConfigsController.m +++ b/ConfigsController.m @@ -67,16 +67,10 @@ if (tableView.selectedRow == 0) return; - Config *toRemove = _configs[tableView.selectedRow]; [_configs removeObjectAtIndex:tableView.selectedRow]; - - if (toRemove == _currentConfig) - _currentConfig = _configs[0]; - if (toRemove == manualConfig) - manualConfig = _configs[0]; - - [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged]; [tableView reloadData]; + [(ApplicationController *)[[NSApplication sharedApplication] delegate] configsChanged]; + [self activateConfig:_configs[0]]; [self save]; } diff --git a/TargetController.m b/TargetController.m index 7a4fd05..2ecb060 100644 --- a/TargetController.m +++ b/TargetController.m @@ -215,7 +215,6 @@ } - (void)refreshConfigs { - // TODO: This doesn't work when removing configs. NSInteger initialIndex = configPopup.indexOfSelectedItem; [configPopup.menu removeAllItems]; for (Config *config in configsController.configs) { -- 2.30.2