Skip to content

Commit 2aa1523

Browse files
committed
GUI: Removed XML format version 1
1 parent ae563f6 commit 2aa1523

6 files changed

Lines changed: 11 additions & 292 deletions

File tree

gui/gui.pro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ HEADERS += aboutdialog.h \
106106
translationhandler.h \
107107
txtreport.h \
108108
xmlreport.h \
109-
xmlreportv1.h \
110109
xmlreportv2.h \
111110
librarydialog.h \
112111
cppchecklibrarydata.h \
@@ -144,7 +143,6 @@ SOURCES += aboutdialog.cpp \
144143
translationhandler.cpp \
145144
txtreport.cpp \
146145
xmlreport.cpp \
147-
xmlreportv1.cpp \
148146
xmlreportv2.cpp \
149147
librarydialog.cpp \
150148
cppchecklibrarydata.cpp \

gui/mainwindow.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ void MainWindow::performSelectedFilesCheck(QStringList selectedFilesList)
11571157
void MainWindow::save()
11581158
{
11591159
QString selectedFilter;
1160-
const QString filter(tr("XML files version 2 (*.xml);;XML files version 1 (*.xml);;Text files (*.txt);;CSV files (*.csv)"));
1160+
const QString filter(tr("XML files (*.xml);;Text files (*.txt);;CSV files (*.csv)"));
11611161
QString selectedFile = QFileDialog::getSaveFileName(this,
11621162
tr("Save the report file"),
11631163
getPath(SETTINGS_LAST_RESULT_PATH),
@@ -1166,14 +1166,7 @@ void MainWindow::save()
11661166

11671167
if (!selectedFile.isEmpty()) {
11681168
Report::Type type = Report::TXT;
1169-
if (selectedFilter == tr("XML files version 1 (*.xml)")) {
1170-
QMessageBox msgBox(QMessageBox::Icon::Warning, tr("Deprecated XML format"), tr("XML format 1 is deprecated and will be removed in cppcheck 1.81."), QMessageBox::StandardButton::Ok);
1171-
msgBox.exec();
1172-
1173-
type = Report::XML;
1174-
if (!selectedFile.endsWith(".xml", Qt::CaseInsensitive))
1175-
selectedFile += ".xml";
1176-
} else if (selectedFilter == tr("XML files version 2 (*.xml)")) {
1169+
if (selectedFilter == tr("XML files (*.xml)")) {
11771170
type = Report::XMLV2;
11781171
if (!selectedFile.endsWith(".xml", Qt::CaseInsensitive))
11791172
selectedFile += ".xml";
@@ -1187,7 +1180,7 @@ void MainWindow::save()
11871180
selectedFile += ".csv";
11881181
} else {
11891182
if (selectedFile.endsWith(".xml", Qt::CaseInsensitive))
1190-
type = Report::XML;
1183+
type = Report::XMLV2;
11911184
else if (selectedFile.endsWith(".txt", Qt::CaseInsensitive))
11921185
type = Report::TXT;
11931186
else if (selectedFile.endsWith(".csv", Qt::CaseInsensitive))

gui/report.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class Report : public QObject {
3535

3636
enum Type {
3737
TXT,
38-
XML,
3938
XMLV2,
4039
CSV,
4140
};

gui/resultsview.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "report.h"
3434
#include "txtreport.h"
3535
#include "xmlreport.h"
36-
#include "xmlreportv1.h"
3736
#include "xmlreportv2.h"
3837
#include "csvreport.h"
3938
#include "printablereport.h"
@@ -153,9 +152,6 @@ void ResultsView::save(const QString &filename, Report::Type type) const
153152
case Report::TXT:
154153
report = new TxtReport(filename);
155154
break;
156-
case Report::XML:
157-
report = new XmlReportV1(filename);
158-
break;
159155
case Report::XMLV2:
160156
report = new XmlReportV2(filename);
161157
break;
@@ -313,12 +309,15 @@ void ResultsView::readErrorsXml(const QString &filename)
313309
msgBox.exec();
314310
return;
315311
}
312+
if (version == 1) {
313+
QMessageBox msgBox;
314+
msgBox.setText(tr("XML format version 1 is no longer supported."));
315+
msgBox.setIcon(QMessageBox::Critical);
316+
msgBox.exec();
317+
return;
318+
}
316319

317-
XmlReport *report = NULL;
318-
if (version == 1)
319-
report = new XmlReportV1(filename);
320-
else if (version == 2)
321-
report = new XmlReportV2(filename);
320+
XmlReport *report = new XmlReportV2(filename);
322321

323322
QList<ErrorItem> errors;
324323
if (report) {

gui/xmlreportv1.cpp

Lines changed: 0 additions & 178 deletions
This file was deleted.

gui/xmlreportv1.h

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)