MCPcopy Create free account
hub / github.com/KDE/kdevelop / suggestionTriggered

Method suggestionTriggered

plugins/execute/nativeappconfig.cpp:397–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397void 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"

Callers

nothing calls this directly

Calls 15

splitWithEscapingFunction · 0.85
qvariantToStringFunction · 0.85
projectControllerMethod · 0.80
runControllerMethod · 0.80
writeEntryMethod · 0.80
itemForPathFunction · 0.70
projectModelMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
atMethod · 0.45
supportedModesMethod · 0.45

Tested by

no test coverage detected