2014-09-25 11:11:58 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** This file is part of Qt Creator.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
2014-09-25 11:11:58 +02:00
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-14 10:59:10 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
2016-01-14 10:59:10 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2014-09-25 11:11:58 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2016-02-26 14:14:49 +01:00
|
|
|
#include <debugger/analyzer/analyzermanager.h>
|
2016-01-13 12:11:07 +01:00
|
|
|
#include <cpptools/projectinfo.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 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;
|
2016-04-21 15:31:10 +02:00
|
|
|
class DummyRunConfiguration;
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2016-03-01 07:51:06 +01:00
|
|
|
const char ClangStaticAnalyzerPerspectiveId[] = "ClangStaticAnalyzer.Perspective";
|
|
|
|
|
const char ClangStaticAnalyzerActionId[] = "ClangStaticAnalyzer.Action";
|
|
|
|
|
const char ClangStaticAnalyzerDockId[] = "ClangStaticAnalyzer.Dock";
|
2015-02-18 16:05:46 +01:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2016-03-02 13:57:37 +01:00
|
|
|
Debugger::AnalyzerRunControl *createRunControl(ProjectExplorer::RunConfiguration *runConfiguration,
|
2016-01-05 08:58:01 +01:00
|
|
|
Core::Id runMode);
|
2016-04-21 15:31:10 +02: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();
|
2016-03-02 13:57:37 +01:00
|
|
|
void updateRunActions();
|
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;
|
2015-06-19 15:37:16 +02:00
|
|
|
ClangStaticAnalyzerDiagnosticView *m_diagnosticView;
|
2014-09-25 11:11:58 +02:00
|
|
|
|
2016-03-02 13:57:37 +01:00
|
|
|
QAction *m_startAction = 0;
|
|
|
|
|
QAction *m_stopAction = 0;
|
2014-09-25 11:11:58 +02:00
|
|
|
QAction *m_goBack;
|
|
|
|
|
QAction *m_goNext;
|
2016-04-21 15:31:10 +02:00
|
|
|
QHash<ProjectExplorer::Target *, DummyRunConfiguration *> m_runConfigs;
|
2015-02-04 15:19:30 +01:00
|
|
|
bool m_running;
|
2016-03-02 13:57:37 +01:00
|
|
|
bool m_toolBusy = false;
|
2014-09-25 11:11:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ClangStaticAnalyzer
|