MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / collectBuildResults

Method collectBuildResults

tools/BuildProjectTool.cpp:208–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208QString BuildProjectTool::collectBuildResults(
209 bool success, const QString &projectName, bool isRebuild)
210{
211 QStringList results;
212
213 // Build header
214 QString buildType = isRebuild ? QString("Rebuild") : QString("Build");
215 QString statusText = success ? QString("✓ SUCCEEDED") : QString("✗ FAILED");
216
217 results.append(QString("%1 %2 for project '%3'\n")
218 .arg(buildType, statusText, projectName));
219
220 const auto tasks = IssuesTracker::instance().getTasks();
221
222 if (!tasks.isEmpty()) {
223 int errorCount = 0;
224 int warningCount = 0;
225 QStringList issuesList;
226
227 for (const ProjectExplorer::Task &task : tasks) {
228#if QODEASSIST_QT_CREATOR_VERSION >= QT_VERSION_CHECK(18, 0, 0)
229 auto taskType = task.type();
230 auto taskFile = task.file();
231 auto taskLine = task.line();
232 auto taskColumn = task.column();
233#else
234 auto taskType = task.type;
235 auto taskFile = task.file;
236 auto taskLine = task.line;
237 auto taskColumn = task.column;
238#endif
239
240 QString typeStr;
241 switch (taskType) {
242 case ProjectExplorer::Task::Error:
243 typeStr = QString("ERROR");
244 errorCount++;
245 break;
246 case ProjectExplorer::Task::Warning:
247 typeStr = QString("WARNING");
248 warningCount++;
249 break;
250 default:
251 continue;
252 }
253
254 if (issuesList.size() < 50) {
255 QString issueText = QString("[%1] %2").arg(typeStr, task.description());
256
257 if (!taskFile.isEmpty()) {
258 issueText += QString("\n File: %1").arg(taskFile.toUrlishString());
259 if (taskLine > 0) {
260 issueText += QString(":%1").arg(taskLine);
261 if (taskColumn > 0) {
262 issueText += QString(":%1").arg(taskColumn);
263 }
264 }
265 }

Callers

nothing calls this directly

Calls 6

appendMethod · 0.80
getTasksMethod · 0.80
sizeMethod · 0.80
isEmptyMethod · 0.45
typeMethod · 0.45
descriptionMethod · 0.45

Tested by

no test coverage detected