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

Method updateJobName

kdevplatform/project/builderjob.cpp:197–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void BuilderJob::updateJobName()
198{
199 Q_D(BuilderJob);
200
201 // Which items are mentioned in the set
202 // Make it a list to preserve ordering; search overhead (n^2) isn't too big
203 QList< ProjectBaseItem* > registeredItems;
204 // Which build types are mentioned in the set
205 // (Same rationale applies)
206 QList< BuildType > buildTypes;
207 // Whether there are jobs without any specific item
208 bool hasNullItems = false;
209
210 for (const SubJobData& subjob : std::as_const(d->m_metadata)) {
211 if( subjob.item ) {
212 if( !registeredItems.contains( subjob.item ) ) {
213 registeredItems.append( subjob.item );
214 }
215 if( !buildTypes.contains( subjob.type ) ) {
216 buildTypes.append( subjob.type );
217 }
218 } else {
219 hasNullItems = true;
220 }
221 }
222
223 QString itemNames;
224 if( !hasNullItems ) {
225 QStringList itemNamesList;
226 itemNamesList.reserve(registeredItems.size());
227 for (ProjectBaseItem* item : std::as_const(registeredItems)) {
228 itemNamesList << item->text();
229 }
230 itemNames = itemNamesList.join(QLatin1String(", "));
231 } else {
232 itemNames = i18nc( "Unspecified set of build items (e. g. projects, targets)", "Various items" );
233 }
234
235 QString methodNames;
236 QStringList methodNamesList;
237 methodNamesList.reserve(buildTypes.size());
238 for (BuildType type : std::as_const(buildTypes)) {
239 methodNamesList << d->buildTypeToString( type );
240 }
241 methodNames = methodNamesList.join(QLatin1String(", "));
242
243 QString jobName = QStringLiteral( "%1: %2" ).arg( itemNames, methodNames );
244 setObjectName( jobName );
245}
246
247void BuilderJob::start()
248{

Callers 9

runBuilderJobMethod · 0.80
dependencyJobMethod · 0.80
calculateDependenciesMethod · 0.80
installMethod · 0.80
installMethod · 0.80
buildMethod · 0.80
cleanMethod · 0.80
installMethod · 0.80

Calls 7

joinMethod · 0.80
buildTypeToStringMethod · 0.80
containsMethod · 0.45
appendMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected