2014-09-25 11:11:58 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2015-01-15 10:32:57 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd
|
2014-09-25 11:11:58 +02:00
|
|
|
** All rights reserved.
|
2015-01-15 10:32:57 +01:00
|
|
|
** For any questions to The Qt Company, please use contact form at http://www.qt.io/contact-us
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2015-06-25 17:29:41 +02:00
|
|
|
** This file is part of the Qt Enterprise ClangStaticAnalyzer Add-on.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
|
|
|
|
** Licensees holding valid Qt Enterprise licenses may use this file in
|
|
|
|
|
** accordance with the Qt Enterprise License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-15 10:32:57 +01:00
|
|
|
** a written agreement between you and The Qt Company.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please use
|
2015-01-15 10:32:57 +01:00
|
|
|
** contact form at http://www.qt.io/contact-us
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef CLANGSTATICANALYZERTOOL_H
|
|
|
|
|
#define CLANGSTATICANALYZERTOOL_H
|
|
|
|
|
|
|
|
|
|
#include <analyzerbase/ianalyzertool.h>
|
2014-11-05 13:28:44 +01:00
|
|
|
#include <cpptools/cppprojects.h>
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2015-03-03 15:09:27 +01:00
|
|
|
#include <QHash>
|
|
|
|
|
|
2014-09-25 11:11:58 +02:00
|
|
|
namespace Analyzer { class DetailedErrorView; }
|
2015-03-03 15:09:27 +01:00
|
|
|
namespace ProjectExplorer { class Target; }
|
2014-09-25 11:11:58 +02:00
|
|
|
|
|
|
|
|
namespace ClangStaticAnalyzer {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2015-02-19 18:08:38 +01:00
|
|
|
class ClangStaticAnalyzerDiagnosticFilterModel;
|
2014-09-25 11:11:58 +02:00
|
|
|
class ClangStaticAnalyzerDiagnosticModel;
|
|
|
|
|
class ClangStaticAnalyzerDiagnosticView;
|
|
|
|
|
class Diagnostic;
|
2015-03-03 15:09:27 +01:00
|
|
|
class DummyRunConfiguration;
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2015-02-18 16:05:46 +01:00
|
|
|
const char ClangStaticAnalyzerToolId[] = "ClangStaticAnalyzer";
|
|
|
|
|
|
|
|
|
|
class ClangStaticAnalyzerTool : public QObject
|
2014-09-25 11:11:58 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit ClangStaticAnalyzerTool(QObject *parent = 0);
|
2014-11-07 11:32:40 +01:00
|
|
|
CppTools::ProjectInfo projectInfoBeforeBuild() const;
|
|
|
|
|
void resetCursorAndProjectInfoBeforeBuild();
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2015-02-04 15:19:30 +01:00
|
|
|
// For testing.
|
|
|
|
|
bool isRunning() const { return m_running; }
|
|
|
|
|
QList<Diagnostic> diagnostics() const;
|
|
|
|
|
|
2014-09-25 11:11:58 +02:00
|
|
|
QWidget *createWidgets();
|
|
|
|
|
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
|
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
2015-02-20 10:05:44 +01:00
|
|
|
void startTool();
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2015-02-18 16:05:46 +01:00
|
|
|
signals:
|
2015-05-04 14:57:03 +02:00
|
|
|
void finished(bool success); // For testing.
|
2015-02-18 16:05:46 +01:00
|
|
|
|
|
|
|
|
private:
|
2014-09-25 11:11:58 +02:00
|
|
|
void onEngineIsStarting();
|
|
|
|
|
void onNewDiagnosticsAvailable(const QList<Diagnostic> &diagnostics);
|
|
|
|
|
void onEngineFinished();
|
|
|
|
|
|
|
|
|
|
void setBusyCursor(bool busy);
|
2015-03-02 15:35:10 +01:00
|
|
|
void handleStateUpdate();
|
2014-09-25 11:11:58 +02:00
|
|
|
|
|
|
|
|
private:
|
2014-11-07 11:32:40 +01:00
|
|
|
CppTools::ProjectInfo m_projectInfoBeforeBuild;
|
2014-11-05 13:28:44 +01:00
|
|
|
|
2014-09-25 11:11:58 +02:00
|
|
|
ClangStaticAnalyzerDiagnosticModel *m_diagnosticModel;
|
2015-02-19 18:08:38 +01:00
|
|
|
ClangStaticAnalyzerDiagnosticFilterModel *m_diagnosticFilterModel;
|
2014-09-25 11:11:58 +02:00
|
|
|
Analyzer::DetailedErrorView *m_diagnosticView;
|
|
|
|
|
|
|
|
|
|
QAction *m_goBack;
|
|
|
|
|
QAction *m_goNext;
|
2015-03-03 15:09:27 +01:00
|
|
|
QHash<ProjectExplorer::Target *, DummyRunConfiguration *> m_runConfigs;
|
2015-02-04 15:19:30 +01:00
|
|
|
bool m_running;
|
2014-09-25 11:11:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ClangStaticAnalyzer
|
|
|
|
|
|
|
|
|
|
#endif // CLANGSTATICANALYZERTOOL_H
|