| 530 | } |
| 531 | |
| 532 | void KDevelop::RunController::slotProjectClosing(KDevelop::IProject * project) |
| 533 | { |
| 534 | Q_D(RunController); |
| 535 | |
| 536 | if (!d->currentTargetAction) return; |
| 537 | |
| 538 | const auto actions = d->currentTargetAction->actions(); |
| 539 | for (QAction* action : actions) { |
| 540 | LaunchConfiguration* l = static_cast<LaunchConfiguration*>(qvariant_cast<void*>(action->data())); |
| 541 | if ( project == l->project() ) { |
| 542 | l->save(); |
| 543 | d->launchConfigurations.removeAll(l); |
| 544 | delete l; |
| 545 | bool wasSelected = action->isChecked(); |
| 546 | delete action; |
| 547 | if (wasSelected && !d->currentTargetAction->actions().isEmpty()) |
| 548 | d->currentTargetAction->actions().at(0)->setChecked(true); |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | void RunController::debugCurrentLaunch() |
| 554 | { |