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

Function descriptionFromProblem

plugins/problemreporter/problemtreeview.cpp:39–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38namespace {
39QString descriptionFromProblem(IProblem::Ptr problem)
40{
41 QString text;
42 const auto location = problem->finalLocation();
43 if (location.isValid()) {
44 text += location.document.toUrl()
45 .adjusted(QUrl::NormalizePathSegments)
46 .toDisplayString(QUrl::PreferLocalFile);
47 if (location.start().line() >= 0) {
48 text += QLatin1Char(':') + QString::number(location.start().line() + 1);
49 if (location.start().column() >= 0) {
50 text += QLatin1Char(':') + QString::number(location.start().column() + 1);
51 }
52 }
53 text += QLatin1String(": ");
54 }
55 text += problem->description();
56 if (!problem->explanation().isEmpty()) {
57 text += QLatin1Char('\n') + problem->explanation();
58 }
59 return text;
60}
61}
62
63namespace KDevelop

Callers 1

contextMenuEventMethod · 0.85

Calls 9

finalLocationMethod · 0.45
isValidMethod · 0.45
toUrlMethod · 0.45
lineMethod · 0.45
startMethod · 0.45
columnMethod · 0.45
descriptionMethod · 0.45
isEmptyMethod · 0.45
explanationMethod · 0.45

Tested by

no test coverage detected