diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-05-07 17:04:26 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2018-05-11 12:07:48 +0000 |
commit | 947ea4a0518b391200089f4c1ca7c0ceb1fd3e3d (patch) | |
tree | 61aeccac7e53ff122c00ae8409b8ee3aeedc3f8f /src/plugins/clangtools/clangtoolsprojectsettings.h | |
parent | fae0e1833456c780baf7d0b865b5e74370d6d12a (diff) |
ClangTools: Remember selected files
Change-Id: I53227d0ada37b613b7312149bb8e7c15f6bf2bcc
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/clangtools/clangtoolsprojectsettings.h')
-rw-r--r-- | src/plugins/clangtools/clangtoolsprojectsettings.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/plugins/clangtools/clangtoolsprojectsettings.h b/src/plugins/clangtools/clangtoolsprojectsettings.h new file mode 100644 index 0000000000..c2e14e5f21 --- /dev/null +++ b/src/plugins/clangtools/clangtoolsprojectsettings.h @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** 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. +** +** 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. +** +****************************************************************************/ + +#pragma once + +#include <QObject> + +#include <projectexplorer/project.h> + +#include <utils/fileutils.h> + +namespace ClangTools { +namespace Internal { + +// TODO: Incorporate Clang Static Analyzer's ProjectSettings +class ClangToolsProjectSettings : public QObject +{ + Q_OBJECT + +public: + ClangToolsProjectSettings(ProjectExplorer::Project *project); + ~ClangToolsProjectSettings() override; + + QSet<Utils::FileName> selectedDirs() const { return m_selectedDirs; } + void setSelectedDirs(const QSet<Utils::FileName> &value) { m_selectedDirs = value; } + + QSet<Utils::FileName> selectedFiles() const { return m_selectedFiles; } + void setSelectedFiles(const QSet<Utils::FileName> &value) { m_selectedFiles = value; } + +private: + void load(); + void store(); + + ProjectExplorer::Project *m_project; + QSet<Utils::FileName> m_selectedDirs; + QSet<Utils::FileName> m_selectedFiles; +}; + +// TODO: Incorporate Clang Static Analyzer's ProjectSettingsManager +class ClangToolsProjectSettingsManager +{ +public: + ClangToolsProjectSettingsManager(); + + static ClangToolsProjectSettings *getSettings(ProjectExplorer::Project *project); + +private: + static void handleProjectToBeRemoved(ProjectExplorer::Project *project); + + using SettingsMap = QHash<ProjectExplorer::Project *, QSharedPointer<ClangToolsProjectSettings>>; + static SettingsMap m_settings; +}; + +} // namespace Internal +} // namespace ClangTools |