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

Method dependencyJob

plugins/execute/executeplugin.cpp:66–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65
66KJob* ExecutePlugin::dependencyJob( KDevelop::ILaunchConfiguration* cfg ) const
67{
68 const QVariantList deps = KDevelop::stringToQVariant( cfg->config().readEntry( dependencyEntry, QString() ) ).toList();
69 QString depAction = cfg->config().readEntry( dependencyActionEntry, "Nothing" );
70 if( depAction != QLatin1String("Nothing") && !deps.isEmpty() )
71 {
72 KDevelop::ProjectModel* model = KDevelop::ICore::self()->projectController()->projectModel();
73 QList<KDevelop::ProjectBaseItem*> items;
74 for (const QVariant& dep : deps) {
75 KDevelop::ProjectBaseItem* item = model->itemFromIndex( model->pathToIndex( dep.toStringList() ) );
76 if( item )
77 {
78 items << item;
79 }
80 else
81 {
82 const QString messageText = i18n("Couldn't resolve the dependency: %1", dep.toString());
83 auto* message = new Sublime::Message(messageText, Sublime::Message::Error);
84 ICore::self()->uiController()->postMessage(message);
85 }
86 }
87 auto* job = new KDevelop::BuilderJob();
88 if( depAction == QLatin1String("Build") )
89 {
90 job->addItems( KDevelop::BuilderJob::Build, items );
91 } else if( depAction == QLatin1String("Install") )
92 {
93 job->addItems( KDevelop::BuilderJob::Install, items );
94 }
95 job->updateJobName();
96 return job;
97 }
98 return nullptr;
99}
100
101
102QString ExecutePlugin::environmentProfileName(KDevelop::ILaunchConfiguration* cfg) const

Callers 1

makeJobWithDependencyFunction · 0.45

Calls 15

stringToQVariantFunction · 0.85
readEntryMethod · 0.80
projectControllerMethod · 0.80
pathToIndexMethod · 0.80
uiControllerMethod · 0.80
updateJobNameMethod · 0.80
QStringClass · 0.50
toListMethod · 0.45
configMethod · 0.45
isEmptyMethod · 0.45
projectModelMethod · 0.45
itemFromIndexMethod · 0.45

Tested by

no test coverage detected