| 395 | } |
| 396 | |
| 397 | void NativeAppConfigType::suggestionTriggered() |
| 398 | { |
| 399 | auto* action = qobject_cast<QAction*>(sender()); |
| 400 | KDevelop::ProjectModel* model = KDevelop::ICore::self()->projectController()->projectModel(); |
| 401 | KDevelop::ProjectTargetItem* pitem = dynamic_cast<KDevelop::ProjectTargetItem*>(itemForPath(KDevelop::splitWithEscaping(action->data().toString(), QLatin1Char('/'), QLatin1Char('\\')), model)); |
| 402 | if(pitem) { |
| 403 | QPair<QString,QString> launcher = qMakePair( launchers().at( 0 )->supportedModes().at(0), launchers().at( 0 )->id() ); |
| 404 | KDevelop::IProject* p = pitem->project(); |
| 405 | |
| 406 | KDevelop::ILaunchConfiguration* config = KDevelop::ICore::self()->runController()->createLaunchConfiguration(this, launcher, p, pitem->text()); |
| 407 | KConfigGroup cfg = config->config(); |
| 408 | |
| 409 | QStringList splitPath = model->pathFromIndex(pitem->index()); |
| 410 | // QString path = KDevelop::joinWithEscaping(splitPath,'/','\\'); |
| 411 | cfg.writeEntry( ExecutePlugin::projectTargetEntry, splitPath ); |
| 412 | cfg.writeEntry( ExecutePlugin::dependencyEntry, KDevelop::qvariantToString( QVariantList() << splitPath ) ); |
| 413 | cfg.writeEntry( ExecutePlugin::dependencyActionEntry, "Build" ); |
| 414 | cfg.sync(); |
| 415 | |
| 416 | emit signalAddLaunchConfiguration(config); |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | #include "moc_nativeappconfig.cpp" |
nothing calls this directly
no test coverage detected