MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / refreshFilePaths

Method refreshFilePaths

gui/resultstree.cpp:1220–1253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1218}
1219
1220void ResultsTree::refreshFilePaths(ResultItem *fileItem)
1221{
1222 if (!fileItem)
1223 return;
1224
1225 auto refreshItem = [this](ResultItem* item) {
1226 item->setText(QDir::toNativeSeparators(stripPath(item->getErrorPathItem().file, false)));
1227 };
1228
1229 refreshItem(fileItem);
1230
1231 //Loop through all errors within this file
1232 for (int i = 0; i < fileItem->rowCount(); i++) {
1233 //Get error i
1234 auto *error = dynamic_cast<ResultItem*>(fileItem->child(i, COLUMN_FILE));
1235
1236 if (!error) {
1237 continue;
1238 }
1239
1240 //Update this error's text
1241 refreshItem(error);
1242
1243 //Loop through all files within the error
1244 for (int j = 0; j < error->rowCount(); j++) {
1245 //Get file
1246 auto *child = dynamic_cast<ResultItem*>(error->child(j, COLUMN_FILE));
1247 if (child) {
1248 //Update file's path
1249 refreshItem(child);
1250 }
1251 }
1252 }
1253}
1254
1255void ResultsTree::refreshFilePaths()
1256{

Callers

nothing calls this directly

Calls 2

getErrorPathItemMethod · 0.80
rowCountMethod · 0.80

Tested by

no test coverage detected