2016-02-22 17:18:18 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2016 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
|
|
|
|
|
|
2016-02-26 17:50:38 +01:00
|
|
|
#include "cpptools_global.h"
|
|
|
|
|
|
2016-02-22 17:18:18 +01:00
|
|
|
#include "clangdiagnosticconfig.h"
|
|
|
|
|
|
2018-01-19 13:18:43 +01:00
|
|
|
#include <QVector>
|
|
|
|
|
|
2016-02-22 17:18:18 +01:00
|
|
|
namespace CppTools {
|
|
|
|
|
|
2016-02-26 17:50:38 +01:00
|
|
|
class CPPTOOLS_EXPORT ClangDiagnosticConfigsModel
|
2016-02-22 17:18:18 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2016-02-26 17:50:38 +01:00
|
|
|
ClangDiagnosticConfigsModel() = default;
|
2019-01-14 01:40:53 +01:00
|
|
|
explicit ClangDiagnosticConfigsModel(const ClangDiagnosticConfigs &customConfigs);
|
2016-02-22 17:18:18 +01:00
|
|
|
|
|
|
|
|
int size() const;
|
|
|
|
|
const ClangDiagnosticConfig &at(int index) const;
|
|
|
|
|
|
|
|
|
|
void appendOrUpdate(const ClangDiagnosticConfig &config);
|
|
|
|
|
void removeConfigWithId(const Core::Id &id);
|
|
|
|
|
|
2019-01-29 16:03:38 +01:00
|
|
|
ClangDiagnosticConfigs allConfigs() const;
|
|
|
|
|
ClangDiagnosticConfigs customConfigs() const;
|
|
|
|
|
|
2016-02-26 17:50:38 +01:00
|
|
|
bool hasConfigWithId(const Core::Id &id) const;
|
2016-02-22 17:18:18 +01:00
|
|
|
const ClangDiagnosticConfig &configWithId(const Core::Id &id) const;
|
2018-01-19 13:18:43 +01:00
|
|
|
int indexOfConfig(const Core::Id &id) const;
|
2016-02-22 17:18:18 +01:00
|
|
|
|
2016-02-26 17:50:38 +01:00
|
|
|
static QString displayNameWithBuiltinIndication(const ClangDiagnosticConfig &config);
|
2018-01-19 13:18:43 +01:00
|
|
|
static QVector<Core::Id> changedOrRemovedConfigs(const ClangDiagnosticConfigs &oldConfigs,
|
|
|
|
|
const ClangDiagnosticConfigs &newConfigs);
|
2019-01-29 16:03:38 +01:00
|
|
|
static ClangDiagnosticConfig createCustomConfig(const ClangDiagnosticConfig &config,
|
|
|
|
|
const QString &displayName);
|
2018-05-22 16:03:09 +02:00
|
|
|
static QStringList globalDiagnosticOptions();
|
2016-02-22 17:18:18 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ClangDiagnosticConfigs m_diagnosticConfigs;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace CppTools
|