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

Method save

gui/resultsview.cpp:215–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void ResultsView::save(const QString &filename, Report::Type type, const QString& productName) const
216{
217 Report *report = nullptr;
218
219 switch (type) {
220 case Report::CSV:
221 report = new CsvReport(filename);
222 break;
223 case Report::TXT:
224 report = new TxtReport(filename);
225 break;
226 case Report::XMLV2:
227 report = new XmlReportV2(filename, productName);
228 break;
229 }
230
231 if (report) {
232 if (report->create())
233 mUI->mTree->saveResults(report);
234 else {
235 QMessageBox msgBox;
236 msgBox.setText(tr("Failed to save the report."));
237 msgBox.setIcon(QMessageBox::Critical);
238 msgBox.exec();
239 }
240 delete report;
241 report = nullptr;
242 } else {
243 QMessageBox msgBox;
244 msgBox.setText(tr("Failed to save the report."));
245 msgBox.setIcon(QMessageBox::Critical);
246 msgBox.exec();
247 }
248}
249
250void ResultsView::print()
251{

Callers

nothing calls this directly

Calls 2

saveResultsMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected