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

Method suppressIds

gui/mainwindow.cpp:2199–2223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2197}
2198
2199void MainWindow::suppressIds(QStringList ids)
2200{
2201 if (!mProjectFile)
2202 return;
2203 ids.removeDuplicates();
2204
2205 QList<SuppressionList::Suppression> suppressions = mProjectFile->getSuppressions();
2206 for (const QString& id : ids) {
2207 // Remove all matching suppressions
2208 std::string id2 = id.toStdString();
2209 for (int i = 0; i < suppressions.size();) {
2210 if (suppressions[i].errorId == id2)
2211 suppressions.removeAt(i);
2212 else
2213 ++i;
2214 }
2215
2216 SuppressionList::Suppression newSuppression;
2217 newSuppression.errorId = id2;
2218 suppressions << newSuppression;
2219 }
2220
2221 mProjectFile->setSuppressions(suppressions);
2222 mProjectFile->write();
2223}
2224
2225static int getVersion(const QString& nameWithVersion) {
2226 int ret = 0;

Callers

nothing calls this directly

Calls 4

getSuppressionsMethod · 0.80
sizeMethod · 0.45
setSuppressionsMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected