Skip to content

Commit 0d8b7af

Browse files
committed
GUI: Renamed methods in Report
1 parent c4bd702 commit 0d8b7af

15 files changed

Lines changed: 89 additions & 89 deletions

gui/csvreport.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,26 @@ CsvReport::~CsvReport()
3232
{
3333
}
3434

35-
bool CsvReport::Create()
35+
bool CsvReport::create()
3636
{
37-
if (Report::Create()) {
38-
mTxtWriter.setDevice(Report::GetFile());
37+
if (Report::create()) {
38+
mTxtWriter.setDevice(Report::getFile());
3939
return true;
4040
}
4141
return false;
4242
}
4343

44-
void CsvReport::WriteHeader()
44+
void CsvReport::writeHeader()
4545
{
4646
// No header for CSV report
4747
}
4848

49-
void CsvReport::WriteFooter()
49+
void CsvReport::writeFooter()
5050
{
5151
// No footer for CSV report
5252
}
5353

54-
void CsvReport::WriteError(const ErrorItem &error)
54+
void CsvReport::writeError(const ErrorItem &error)
5555
{
5656
/*
5757
Error as CSV line

gui/csvreport.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ class CsvReport : public Report {
4242
* @brief Create the report (file).
4343
* @return true if succeeded, false if file could not be created.
4444
*/
45-
virtual bool Create();
45+
virtual bool create();
4646

4747
/**
4848
* @brief Write report header.
4949
*/
50-
virtual void WriteHeader();
50+
virtual void writeHeader();
5151

5252
/**
5353
* @brief Write report footer.
5454
*/
55-
virtual void WriteFooter();
55+
virtual void writeFooter();
5656

5757
/**
5858
* @brief Write error to report.
5959
* @param error Error data.
6060
*/
61-
virtual void WriteError(const ErrorItem &error);
61+
virtual void writeError(const ErrorItem &error);
6262

6363
private:
6464

gui/printablereport.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ PrintableReport::~PrintableReport()
2828
{
2929
}
3030

31-
bool PrintableReport::Create()
31+
bool PrintableReport::create()
3232
{
3333
return true;
3434
}
3535

36-
void PrintableReport::WriteHeader()
36+
void PrintableReport::writeHeader()
3737
{
3838
// No header for printable report
3939
}
4040

41-
void PrintableReport::WriteFooter()
41+
void PrintableReport::writeFooter()
4242
{
4343
// No footer for printable report
4444
}
4545

46-
void PrintableReport::WriteError(const ErrorItem &error)
46+
void PrintableReport::writeError(const ErrorItem &error)
4747
{
4848
const QString file = QDir::toNativeSeparators(error.errorPath.back().file);
4949
QString line = QString("%1,%2,").arg(file).arg(error.errorPath.back().line);
@@ -53,7 +53,7 @@ void PrintableReport::WriteError(const ErrorItem &error)
5353
mFormattedReport += "\n";
5454
}
5555

56-
QString PrintableReport::GetFormattedReportText() const
56+
QString PrintableReport::getFormattedReportText() const
5757
{
5858
return mFormattedReport;
5959
}

gui/printablereport.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,28 @@ class PrintableReport : public Report {
3838
* @brief Create the report (file).
3939
* @return true if succeeded, false if file could not be created.
4040
*/
41-
virtual bool Create();
41+
virtual bool create();
4242

4343
/**
4444
* @brief Write report header.
4545
*/
46-
virtual void WriteHeader();
46+
virtual void writeHeader();
4747

4848
/**
4949
* @brief Write report footer.
5050
*/
51-
virtual void WriteFooter();
51+
virtual void writeFooter();
5252

5353
/**
5454
* @brief Write error to report.
5555
* @param error Error data.
5656
*/
57-
virtual void WriteError(const ErrorItem &error);
57+
virtual void writeError(const ErrorItem &error);
5858

5959
/**
6060
* @brief Returns the formatted report.
6161
*/
62-
QString GetFormattedReportText() const;
62+
QString getFormattedReportText() const;
6363

6464
private:
6565

gui/report.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19-
#include <QObject>
2019
#include <QString>
2120
#include <QFile>
2221
#include "report.h"
2322

2423
Report::Report(const QString &filename) :
24+
QObject(),
2525
mFilename(filename)
2626
{
2727
}
2828

2929
Report::~Report()
3030
{
31-
Close();
31+
close();
3232
}
3333

34-
bool Report::Create()
34+
bool Report::create()
3535
{
3636
bool succeed = false;
3737
if (!mFile.isOpen()) {
@@ -41,7 +41,7 @@ bool Report::Create()
4141
return succeed;
4242
}
4343

44-
bool Report::Open()
44+
bool Report::open()
4545
{
4646
bool succeed = false;
4747
if (!mFile.isOpen()) {
@@ -51,13 +51,13 @@ bool Report::Open()
5151
return succeed;
5252
}
5353

54-
void Report::Close()
54+
void Report::close()
5555
{
5656
if (mFile.isOpen())
5757
mFile.close();
5858
}
5959

60-
QFile* Report::GetFile()
60+
QFile* Report::getFile()
6161
{
6262
return &mFile;
6363
}

gui/report.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,41 +47,41 @@ class Report : public QObject {
4747
* @brief Create the report (file).
4848
* @return true if succeeded, false if file could not be created.
4949
*/
50-
virtual bool Create();
50+
virtual bool create();
5151

5252
/**
5353
* @brief Open the existing report (file).
5454
* @return true if succeeded, false if file could not be created.
5555
*/
56-
virtual bool Open();
56+
virtual bool open();
5757

5858
/**
5959
* @brief Close the report (file).
6060
*/
61-
virtual void Close();
61+
virtual void close();
6262

6363
/**
6464
* @brief Write report header.
6565
*/
66-
virtual void WriteHeader() = 0;
66+
virtual void writeHeader() = 0;
6767

6868
/**
6969
* @brief Write report footer.
7070
*/
71-
virtual void WriteFooter() = 0;
71+
virtual void writeFooter() = 0;
7272

7373
/**
7474
* @brief Write error to report.
7575
* @param error Error data.
7676
*/
77-
virtual void WriteError(const ErrorItem &error) = 0;
77+
virtual void writeError(const ErrorItem &error) = 0;
7878

7979
protected:
8080

8181
/**
8282
* @brief Get the file object where the report is written to.
8383
*/
84-
QFile* GetFile();
84+
QFile* getFile();
8585

8686
private:
8787

gui/resultstree.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,15 +964,15 @@ QString ResultsTree::SeverityToIcon(Severity::SeverityType severity) const
964964

965965
void ResultsTree::SaveResults(Report *report) const
966966
{
967-
report->WriteHeader();
967+
report->writeHeader();
968968

969969
for (int i = 0; i < mModel.rowCount(); i++) {
970970
QStandardItem *item = mModel.item(i, 0);
971971
if (!isRowHidden(i, QModelIndex()))
972972
SaveErrors(report, item);
973973
}
974974

975-
report->WriteFooter();
975+
report->writeFooter();
976976
}
977977

978978
void ResultsTree::SaveErrors(Report *report, QStandardItem *item) const
@@ -1027,7 +1027,7 @@ void ResultsTree::SaveErrors(Report *report, QStandardItem *item) const
10271027
item.errorPath << e;
10281028
}
10291029

1030-
report->WriteError(item);
1030+
report->writeError(item);
10311031
}
10321032
}
10331033

gui/resultsview.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void ResultsView::Save(const QString &filename, Report::Type type) const
162162
}
163163

164164
if (report) {
165-
if (report->Create())
165+
if (report->create())
166166
mUI.mTree->SaveResults(report);
167167
else {
168168
QMessageBox msgBox;
@@ -211,7 +211,7 @@ void ResultsView::Print(QPrinter* printer)
211211

212212
PrintableReport report;
213213
mUI.mTree->SaveResults(&report);
214-
QTextDocument doc(report.GetFormattedReportText());
214+
QTextDocument doc(report.getFormattedReportText());
215215
doc.print(printer);
216216
}
217217

@@ -322,8 +322,8 @@ void ResultsView::ReadErrorsXml(const QString &filename)
322322

323323
QList<ErrorItem> errors;
324324
if (report) {
325-
if (report->Open())
326-
errors = report->Read();
325+
if (report->open())
326+
errors = report->read();
327327
else {
328328
QMessageBox msgBox;
329329
msgBox.setText(tr("Failed to read the report."));

gui/txtreport.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,26 @@ TxtReport::~TxtReport()
2828
{
2929
}
3030

31-
bool TxtReport::Create()
31+
bool TxtReport::create()
3232
{
33-
if (Report::Create()) {
34-
mTxtWriter.setDevice(Report::GetFile());
33+
if (Report::create()) {
34+
mTxtWriter.setDevice(Report::getFile());
3535
return true;
3636
}
3737
return false;
3838
}
3939

40-
void TxtReport::WriteHeader()
40+
void TxtReport::writeHeader()
4141
{
4242
// No header for txt report
4343
}
4444

45-
void TxtReport::WriteFooter()
45+
void TxtReport::writeFooter()
4646
{
4747
// No footer for txt report
4848
}
4949

50-
void TxtReport::WriteError(const ErrorItem &error)
50+
void TxtReport::writeError(const ErrorItem &error)
5151
{
5252
/*
5353
Error example from the core program in text

gui/txtreport.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ class TxtReport : public Report {
4242
* @brief Create the report (file).
4343
* @return true if succeeded, false if file could not be created.
4444
*/
45-
virtual bool Create();
45+
virtual bool create();
4646

4747
/**
4848
* @brief Write report header.
4949
*/
50-
virtual void WriteHeader();
50+
virtual void writeHeader();
5151

5252
/**
5353
* @brief Write report footer.
5454
*/
55-
virtual void WriteFooter();
55+
virtual void writeFooter();
5656

5757
/**
5858
* @brief Write error to report.
5959
* @param error Error data.
6060
*/
61-
virtual void WriteError(const ErrorItem &error);
61+
virtual void writeError(const ErrorItem &error);
6262

6363
private:
6464

0 commit comments

Comments
 (0)