File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * Cppcheck - A tool for static C/C++ code analysis
3+ * Copyright (C) 2007-2010 Daniel Marjamäki and Cppcheck team.
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+
21+ ErrorItem::ErrorItem (const ErrorItem &item)
22+ {
23+ file = item.file ;
24+ files = item.files ;
25+ lines = item.lines ;
26+ id = item.id ;
27+ severity = item.severity ;
28+ msg = item.msg ;
29+ }
30+
31+ ErrorItem::ErrorItem (const ErrorLine &line)
32+ {
33+ file = line.file ;
34+ files.append (line.file );
35+ lines.append (line.line .toUInt ());
36+ id = line.id ;
37+ severity = line.severity ;
38+ msg = line.msg ;
39+ }
Original file line number Diff line number Diff line change 2222#include < QString>
2323#include < QStringList>
2424
25+ class ErrorLine ;
26+
2527// / @addtogroup GUI
2628// / @{
2729
3133class ErrorItem
3234{
3335public:
36+ ErrorItem () { }
37+ ErrorItem (const ErrorItem &item);
38+ ErrorItem (const ErrorLine &line);
39+
3440 QString file;
3541 QStringList files;
3642 QList<unsigned int > lines;
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ SOURCES += main.cpp \
7171 aboutdialog.cpp \
7272 fileviewdialog.cpp \
7373 projectfile.cpp \
74+ erroritem.cpp \
7475 report.cpp \
7576 txtreport.cpp \
7677 xmlreport.cpp \
Original file line number Diff line number Diff line change 2020#include < QApplication>
2121#include < QTextCodec>
2222#include < QTranslator>
23+ #include < QMetaType>
2324#include " mainwindow.h"
2425
2526int main (int argc, char *argv[])
2627{
2728 QApplication app (argc, argv);
2829 app.setWindowIcon (QIcon (" :icon.png" ));
2930
31+ // Register this metatype that is used to transfer error info
32+ qRegisterMetaType<QList<unsigned int >>(" QList<unsigned int>" );
33+
3034 // Set codecs so that UTF-8 strings in sources are handled correctly.
3135 QTextCodec::setCodecForTr (QTextCodec::codecForName (" UTF-8" ));
3236 QTextCodec::setCodecForCStrings (QTextCodec::codecForName (" UTF-8" ));
You can’t perform that action at this time.
0 commit comments