Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 52 lines (47 sloc) 1.546 kB
352941f @kimmov GUI: Fix transporting errors.
kimmov authored
1 /*
2 * Cppcheck - A tool for static C/C++ code analysis
ff11ba9 @danmar Updated copyright year to 2015
authored
3 * Copyright (C) 2007-2015 Daniel Marjamäki and Cppcheck team.
352941f @kimmov GUI: Fix transporting errors.
kimmov authored
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "erroritem.h"
20
d8ced1d @kimmov GUI: Initialize Severity in ErrorItem constructor.
kimmov authored
21 ErrorItem::ErrorItem()
22 : severity(Severity::none)
0112b9e @kimmov GUI: Add option for enabling inconclusive checks.
kimmov authored
23 , inconclusive(false)
d8ced1d @kimmov GUI: Initialize Severity in ErrorItem constructor.
kimmov authored
24 {
25 }
26
352941f @kimmov GUI: Fix transporting errors.
kimmov authored
27 ErrorItem::ErrorItem(const ErrorLine &line)
67fb2dc @PKEuS Removed unnecessary copy-ctor and dtor in class ErrorItem - they are …
PKEuS authored
28 : file(line.file)
29 , files(line.file)
30 , errorId(line.errorId)
31 , severity(line.severity)
32 , inconclusive(line.inconclusive)
33 , summary(line.summary)
34 , message(line.message)
352941f @kimmov GUI: Fix transporting errors.
kimmov authored
35 {
801afae @kimmov GUI: Refactor linenumber in ErrorLine to unsigned int.
kimmov authored
36 lines.append(line.line);
352941f @kimmov GUI: Fix transporting errors.
kimmov authored
37 }
20a4f1e @kimmov GUI: Output debug errors to log view.
kimmov authored
38
39 QString ErrorItem::ToString() const
40 {
4c24b6a @kimmov GUI: Rename ErrorItem::id to ErrorItem::errorId.
kimmov authored
41 QString str = file + " - " + errorId + " - ";
f9c97c7 @kimmov GUI: Add support for inconclusive errors.
kimmov authored
42 if (inconclusive)
43 str += "inconclusive ";
44 str += GuiSeverity::toString(severity) +"\n";
50dba88 @kimmov Fix formatting of debug messages to log view.
kimmov authored
45 str += summary + "\n";
46 str += message + "\n";
6f8e42a @danmar changed the astyle formatting flags
authored
47 for (int i = 0; i < files.size(); i++) {
50dba88 @kimmov Fix formatting of debug messages to log view.
kimmov authored
48 str += " " + files[i] + ": " + QString::number(lines[i]) + "\n";
49 }
20a4f1e @kimmov GUI: Output debug errors to log view.
kimmov authored
50 return str;
51 }
Something went wrong with that request. Please try again.