Changeset View
Changeset View
Standalone View
Standalone View
plugins/clazy/problem_model.h
- This file was added.
1 | /* This file is part of KDevelop | ||||
---|---|---|---|---|---|
2 | | ||||
3 | Copyright 2018 Anton Anikin <anton@anikin.xyz> | ||||
4 | | ||||
5 | This program is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU General Public | ||||
7 | License as published by the Free Software Foundation; either | ||||
8 | version 2 of the License, or (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 GNU | ||||
13 | 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; see the file COPYING. If not, write to | ||||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
18 | Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | #ifndef KDEVCLAZY_PROBLEM_MODEL_H | ||||
22 | #define KDEVCLAZY_PROBLEM_MODEL_H | ||||
23 | | ||||
24 | #include <shell/problemmodel.h> | ||||
25 | | ||||
26 | namespace KDevelop | ||||
27 | { | ||||
28 | class IProject; | ||||
29 | } | ||||
30 | | ||||
31 | namespace Clazy | ||||
32 | { | ||||
33 | | ||||
34 | class Plugin; | ||||
35 | | ||||
36 | class ProblemModel : public KDevelop::ProblemModel | ||||
37 | { | ||||
38 | Q_OBJECT | ||||
39 | | ||||
40 | public: | ||||
41 | explicit ProblemModel(Plugin* plugin); | ||||
42 | ~ProblemModel() override; | ||||
43 | | ||||
44 | KDevelop::IProject* project() const; | ||||
45 | | ||||
46 | void addProblems(const QVector<KDevelop::IProblem::Ptr>& problems); | ||||
47 | | ||||
48 | void setProblems(); | ||||
49 | using KDevelop::ProblemModel::setProblems; | ||||
50 | | ||||
51 | void reset(); | ||||
52 | void reset(KDevelop::IProject* project, const QString& path); | ||||
53 | | ||||
54 | void show(); | ||||
55 | | ||||
56 | void forceFullUpdate() override; | ||||
57 | | ||||
58 | private: | ||||
59 | Plugin* m_plugin; | ||||
60 | | ||||
61 | KDevelop::IProject* m_project; | ||||
62 | QString m_path; | ||||
63 | | ||||
64 | QVector<KDevelop::IProblem::Ptr> m_problems; | ||||
65 | }; | ||||
66 | | ||||
67 | } | ||||
68 | | ||||
69 | #endif |