| 164 | } |
| 165 | |
| 166 | void CustomBuildSystemConfigWidget::removeConfig() |
| 167 | { |
| 168 | int curidx = ui->currentConfig->currentIndex(); |
| 169 | Q_ASSERT( curidx < configs.length() && curidx >= 0 ); |
| 170 | configs.removeAt( curidx ); |
| 171 | ui->currentConfig->removeItem( curidx ); |
| 172 | |
| 173 | // Make sure the new index is valid if possible, removing the first index |
| 174 | // would otherwise set the index to -1 and that will cause havoc in changeCurrentConfig |
| 175 | // since it clears the config if a negative index comes in. I'm not sure that is actually |
| 176 | // correct, but well easier to fix and understand here right now and the combobox should |
| 177 | // be dropped ultimately anyway I guess - or at least not be editable anymore. |
| 178 | int newidx = curidx > 0 ? curidx - 1 : 0; |
| 179 | ui->currentConfig->setCurrentIndex( newidx ); |
| 180 | changeCurrentConfig( ui->currentConfig->currentIndex() ); |
| 181 | } |
| 182 | |
| 183 | void CustomBuildSystemConfigWidget::verify() { |
| 184 | Q_ASSERT( ui->currentConfig->count() == configs.count() ); |
nothing calls this directly
no test coverage detected