Changeset View
Changeset View
Standalone View
Standalone View
plugins/clazy/job.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_JOB_H | ||||
22 | #define KDEVCLAZY_JOB_H | ||||
23 | | ||||
24 | #include <interfaces/iproblem.h> | ||||
25 | #include <outputview/outputexecutejob.h> | ||||
26 | | ||||
27 | class QElapsedTimer; | ||||
28 | | ||||
29 | namespace Clazy | ||||
30 | { | ||||
31 | | ||||
32 | class ChecksDB; | ||||
33 | class JobParameters; | ||||
34 | | ||||
35 | class Job : public KDevelop::OutputExecuteJob | ||||
36 | { | ||||
37 | Q_OBJECT | ||||
38 | | ||||
39 | public: | ||||
40 | Job(const JobParameters& params, QSharedPointer<const ChecksDB> db); | ||||
41 | ~Job() override; | ||||
42 | | ||||
43 | void start() override; | ||||
44 | | ||||
45 | Q_SIGNALS: | ||||
46 | void problemsDetected(const QVector<KDevelop::IProblem::Ptr>& problems); | ||||
47 | | ||||
48 | protected Q_SLOTS: | ||||
49 | void postProcessStdout(const QStringList& lines) override; | ||||
50 | void postProcessStderr(const QStringList& lines) override; | ||||
51 | | ||||
52 | void childProcessExited(int exitCode, QProcess::ExitStatus exitStatus) override; | ||||
53 | void childProcessError(QProcess::ProcessError processError) override; | ||||
54 | | ||||
55 | protected: | ||||
56 | Job(); | ||||
57 | | ||||
58 | QString buildMakefile(const JobParameters& params); | ||||
59 | | ||||
60 | QSharedPointer<const ChecksDB> m_db; | ||||
61 | QScopedPointer<QElapsedTimer> m_timer; | ||||
62 | | ||||
63 | QStringList m_standardOutput; | ||||
64 | QStringList m_stderrOutput; | ||||
65 | | ||||
66 | int m_totalCount = 0; | ||||
67 | int m_finishedCount = 0; | ||||
68 | }; | ||||
69 | | ||||
70 | } | ||||
71 | #endif |