| 412 | } |
| 413 | |
| 414 | KJob* RunController::execute(const QString& runMode, ILaunchConfiguration* launch) |
| 415 | { |
| 416 | if( !launch ) |
| 417 | { |
| 418 | qCDebug(SHELL) << "execute called without launch config!"; |
| 419 | return nullptr; |
| 420 | } |
| 421 | auto* run = static_cast<LaunchConfiguration*>(launch); |
| 422 | //TODO: Port to launch framework, probably needs to be part of the launcher |
| 423 | //if(!run.dependencies().isEmpty()) |
| 424 | // ICore::self()->documentController()->saveAllDocuments(IDocument::Silent); |
| 425 | |
| 426 | //foreach(KJob* job, run.dependencies()) |
| 427 | //{ |
| 428 | // jobs.append(job); |
| 429 | //} |
| 430 | |
| 431 | qCDebug(SHELL) << "mode:" << runMode; |
| 432 | QString launcherId = run->launcherForMode( runMode ); |
| 433 | qCDebug(SHELL) << "launcher id:" << launcherId; |
| 434 | |
| 435 | ILauncher* launcher = run->type()->launcherForId( launcherId ); |
| 436 | |
| 437 | if( !launcher ) { |
| 438 | const QString messageText = i18n("The current launch configuration does not support the '%1' mode.", runMode); |
| 439 | auto* message = new Sublime::Message(messageText, Sublime::Message::Error); |
| 440 | ICore::self()->uiController()->postMessage(message); |
| 441 | return nullptr; |
| 442 | } |
| 443 | |
| 444 | KJob* launchJob = launcher->start(runMode, run); |
| 445 | registerJob(launchJob); |
| 446 | return launchJob; |
| 447 | } |
| 448 | |
| 449 | void RunController::setupActions() |
| 450 | { |
no test coverage detected