2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2018 Sergey Morozov
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2018-07-30 21:42:47 +03:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QHash>
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
|
|
namespace Utils {
|
2019-05-28 13:49:26 +02:00
|
|
|
class FilePath;
|
2019-12-17 14:07:53 +01:00
|
|
|
using FilePaths = QList<FilePath>;
|
2018-07-30 21:42:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
class Project;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
class IDocument;
|
|
|
|
|
class IEditor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Cppcheck {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class CppcheckTextMarkManager;
|
|
|
|
|
class CppcheckTool;
|
|
|
|
|
|
|
|
|
|
class CppcheckTrigger final : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit CppcheckTrigger(CppcheckTextMarkManager &marks, CppcheckTool &tool);
|
|
|
|
|
~CppcheckTrigger() override;
|
|
|
|
|
|
|
|
|
|
void recheck();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void checkEditors(const QList<Core::IEditor *> &editors = {});
|
|
|
|
|
void removeEditors(const QList<Core::IEditor *> &editors = {});
|
|
|
|
|
void checkChangedDocument(Core::IDocument *document);
|
|
|
|
|
void changeCurrentProject(ProjectExplorer::Project *project);
|
|
|
|
|
void updateProjectFiles(ProjectExplorer::Project *project);
|
2019-12-17 14:07:53 +01:00
|
|
|
void check(const Utils::FilePaths &files);
|
|
|
|
|
void remove(const Utils::FilePaths &files);
|
2018-07-30 21:42:47 +03:00
|
|
|
|
|
|
|
|
CppcheckTextMarkManager &m_marks;
|
|
|
|
|
CppcheckTool &m_tool;
|
|
|
|
|
QPointer<ProjectExplorer::Project> m_currentProject;
|
2019-05-28 13:49:26 +02:00
|
|
|
QHash<Utils::FilePath, QDateTime> m_checkedFiles;
|
2018-07-30 21:42:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Cppcheck
|