forked from qt-creator/qt-creator
ClangTools: Proliferate use of FilePath
Change-Id: I3eb16546a729ab01c10e37572adac9aef83f5cd4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -896,12 +896,12 @@ static CheckResult canAnalyze()
|
||||
{
|
||||
const ClangDiagnosticConfig config = diagnosticConfig(runSettings().diagnosticConfigId());
|
||||
|
||||
if (config.isClangTidyEnabled() && !isFileExecutable(clangTidyExecutable())) {
|
||||
if (config.isClangTidyEnabled() && !clangTidyExecutable().isExecutableFile()) {
|
||||
return {CheckResult::InvalidTidyExecutable,
|
||||
ClangTool::tr("Set a valid Clang-Tidy executable.")};
|
||||
}
|
||||
|
||||
if (config.isClazyEnabled() && !isFileExecutable(clazyStandaloneExecutable())) {
|
||||
if (config.isClazyEnabled() && !clazyStandaloneExecutable().isExecutableFile()) {
|
||||
return {CheckResult::InvalidClazyExecutable,
|
||||
ClangTool::tr("Set a valid Clazy-Standalone executable.")};
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ AnalyzeUnit::AnalyzeUnit(const FileInfo &fileInfo,
|
||||
UseLanguageDefines::No,
|
||||
UseBuildSystemWarnings::No,
|
||||
clangVersion,
|
||||
clangIncludeDir.toString());
|
||||
clangIncludeDir);
|
||||
file = fileInfo.file.toString();
|
||||
arguments = extraClangToolsPrependOptions();
|
||||
arguments.append(optionsBuilder.build(fileInfo.kind, CppTools::getPchUsage()));
|
||||
|
||||
@@ -101,11 +101,11 @@ QStringList ClangToolRunner::mainToolArguments() const
|
||||
|
||||
bool ClangToolRunner::supportsVFSOverlay() const
|
||||
{
|
||||
static QMap<QString, bool> vfsCapabilities;
|
||||
static QMap<FilePath, bool> vfsCapabilities;
|
||||
auto it = vfsCapabilities.find(m_executable);
|
||||
if (it == vfsCapabilities.end()) {
|
||||
QtcProcess p;
|
||||
p.setCommand({FilePath::fromString(m_executable), {"--help"}});
|
||||
p.setCommand({m_executable, {"--help"}});
|
||||
p.runBlocking();
|
||||
it = vfsCapabilities.insert(m_executable, p.allOutput().contains("vfsoverlay"));
|
||||
}
|
||||
@@ -137,7 +137,7 @@ bool ClangToolRunner::run(const QString &fileToAnalyze, const QStringList &compi
|
||||
|
||||
m_outputFilePath = createOutputFilePath(m_outputDirPath, fileToAnalyze);
|
||||
QTC_ASSERT(!m_outputFilePath.isEmpty(), return false);
|
||||
m_commandLine = {FilePath::fromString(m_executable), m_argsCreator(compilerOptions)};
|
||||
m_commandLine = {m_executable, m_argsCreator(compilerOptions)};
|
||||
|
||||
qCDebug(LOG).noquote() << "Starting" << m_commandLine.toUserOutput();
|
||||
m_process->setCommand(m_commandLine);
|
||||
|
||||
@@ -46,13 +46,13 @@ public:
|
||||
|
||||
void init(const Utils::FilePath &outputDirPath, const Utils::Environment &environment);
|
||||
void setName(const QString &name) { m_name = name; }
|
||||
void setExecutable(const QString &executable) { m_executable = executable; }
|
||||
void setExecutable(const Utils::FilePath &executable) { m_executable = executable; }
|
||||
void setArgsCreator(const ArgsCreator &argsCreator) { m_argsCreator = argsCreator; }
|
||||
void setOutputFileFormat(const OutputFileFormat &format) { m_outputFileFormat = format; }
|
||||
void setVFSOverlay(const QString overlayFilePath) { m_overlayFilePath = overlayFilePath; }
|
||||
|
||||
QString name() const { return m_name; }
|
||||
QString executable() const { return m_executable; }
|
||||
Utils::FilePath executable() const { return m_executable; }
|
||||
OutputFileFormat outputFileFormat() const { return m_outputFileFormat; }
|
||||
QString fileToAnalyze() const { return m_fileToAnalyze; }
|
||||
QString outputFilePath() const { return m_outputFilePath; }
|
||||
@@ -83,7 +83,7 @@ private:
|
||||
Utils::QtcProcess *m_process = nullptr;
|
||||
|
||||
QString m_name;
|
||||
QString m_executable;
|
||||
Utils::FilePath m_executable;
|
||||
ArgsCreator m_argsCreator;
|
||||
OutputFileFormat m_outputFileFormat = OutputFileFormat::Yaml;
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ static const char analyzeOpenFilesKey[] = "AnalyzeOpenFiles";
|
||||
static const char oldDiagnosticConfigIdKey[] = "diagnosticConfigId";
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace Utils;
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
@@ -151,8 +152,8 @@ void ClangToolsSettings::readSettings()
|
||||
|
||||
QSettings *s = Core::ICore::settings();
|
||||
s->beginGroup(Constants::SETTINGS_ID);
|
||||
m_clangTidyExecutable = s->value(clangTidyExecutableKey).toString();
|
||||
m_clazyStandaloneExecutable = s->value(clazyStandaloneExecutableKey).toString();
|
||||
m_clangTidyExecutable = FilePath::fromVariant(s->value(clangTidyExecutableKey));
|
||||
m_clazyStandaloneExecutable = FilePath::fromVariant(s->value(clazyStandaloneExecutableKey));
|
||||
m_diagnosticConfigs.append(diagnosticConfigsFromSettings(s));
|
||||
|
||||
QVariantMap map;
|
||||
@@ -184,8 +185,8 @@ void ClangToolsSettings::writeSettings()
|
||||
QSettings *s = Core::ICore::settings();
|
||||
s->beginGroup(Constants::SETTINGS_ID);
|
||||
|
||||
s->setValue(clangTidyExecutableKey, m_clangTidyExecutable);
|
||||
s->setValue(clazyStandaloneExecutableKey, m_clazyStandaloneExecutable);
|
||||
s->setValue(clangTidyExecutableKey, m_clangTidyExecutable.toVariant());
|
||||
s->setValue(clazyStandaloneExecutableKey, m_clazyStandaloneExecutable.toVariant());
|
||||
diagnosticConfigsToSettings(s, m_diagnosticConfigs);
|
||||
|
||||
QVariantMap map;
|
||||
@@ -198,24 +199,22 @@ void ClangToolsSettings::writeSettings()
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void ClangToolsSettings::setClangTidyExecutable(const QString &path)
|
||||
void ClangToolsSettings::setClangTidyExecutable(const FilePath &path)
|
||||
{
|
||||
m_clangTidyExecutable = path;
|
||||
m_clangTidyVersion = {};
|
||||
}
|
||||
|
||||
void ClangTools::Internal::ClangToolsSettings::setClazyStandaloneExecutable(const QString &path)
|
||||
void ClangToolsSettings::setClazyStandaloneExecutable(const FilePath &path)
|
||||
{
|
||||
m_clazyStandaloneExecutable = path;
|
||||
m_clazyVersion = {};
|
||||
}
|
||||
|
||||
static QVersionNumber getVersionNumber(QVersionNumber &version, const QString &toolFilePath)
|
||||
static QVersionNumber getVersionNumber(QVersionNumber &version, const FilePath &toolFilePath)
|
||||
{
|
||||
if (version.isNull() && !toolFilePath.isEmpty()) {
|
||||
version = QVersionNumber::fromString(queryVersion(Utils::FilePath::fromString(toolFilePath),
|
||||
QueryFailMode::Silent));
|
||||
};
|
||||
if (version.isNull() && !toolFilePath.isEmpty())
|
||||
version = QVersionNumber::fromString(queryVersion(toolFilePath, QueryFailMode::Silent));
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,11 +77,11 @@ public:
|
||||
static ClangToolsSettings *instance();
|
||||
void writeSettings();
|
||||
|
||||
QString clangTidyExecutable() const { return m_clangTidyExecutable; }
|
||||
void setClangTidyExecutable(const QString &path);
|
||||
Utils::FilePath clangTidyExecutable() const { return m_clangTidyExecutable; }
|
||||
void setClangTidyExecutable(const Utils::FilePath &path);
|
||||
|
||||
QString clazyStandaloneExecutable() const { return m_clazyStandaloneExecutable; }
|
||||
void setClazyStandaloneExecutable(const QString &path);
|
||||
Utils::FilePath clazyStandaloneExecutable() const { return m_clazyStandaloneExecutable; }
|
||||
void setClazyStandaloneExecutable(const Utils::FilePath &path);
|
||||
|
||||
CppTools::ClangDiagnosticConfigs diagnosticConfigs() const { return m_diagnosticConfigs; }
|
||||
void setDiagnosticConfigs(const CppTools::ClangDiagnosticConfigs &configs)
|
||||
@@ -101,8 +101,8 @@ private:
|
||||
void readSettings();
|
||||
|
||||
// Executables
|
||||
QString m_clangTidyExecutable;
|
||||
QString m_clazyStandaloneExecutable;
|
||||
Utils::FilePath m_clangTidyExecutable;
|
||||
Utils::FilePath m_clazyStandaloneExecutable;
|
||||
|
||||
// Diagnostic Configs
|
||||
CppTools::ClangDiagnosticConfigs m_diagnosticConfigs;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
#include <utils/checkablemessagebox.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/filepath.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
@@ -45,6 +46,7 @@
|
||||
#include <cpptools/clangdiagnosticconfigsmodel.h>
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace Utils;
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
@@ -170,46 +172,36 @@ void showHintAboutBuildBeforeAnalysis()
|
||||
"ClangToolsDisablingBuildBeforeAnalysisHint");
|
||||
}
|
||||
|
||||
bool isFileExecutable(const QString &filePath)
|
||||
FilePath shippedClangTidyExecutable()
|
||||
{
|
||||
if (filePath.isEmpty())
|
||||
return false;
|
||||
|
||||
const QFileInfo fileInfo(filePath);
|
||||
return fileInfo.exists() && fileInfo.isFile() && fileInfo.isExecutable();
|
||||
}
|
||||
|
||||
QString shippedClangTidyExecutable()
|
||||
{
|
||||
const QString shippedExecutable = Core::ICore::clangTidyExecutable(CLANG_BINDIR);
|
||||
if (isFileExecutable(shippedExecutable))
|
||||
const FilePath shippedExecutable = Core::ICore::clangTidyExecutable(CLANG_BINDIR);
|
||||
if (shippedExecutable.isExecutableFile())
|
||||
return shippedExecutable;
|
||||
return {};
|
||||
}
|
||||
|
||||
QString shippedClazyStandaloneExecutable()
|
||||
FilePath shippedClazyStandaloneExecutable()
|
||||
{
|
||||
const QString shippedExecutable = Core::ICore::clazyStandaloneExecutable(CLANG_BINDIR);
|
||||
if (isFileExecutable(shippedExecutable))
|
||||
const FilePath shippedExecutable = Core::ICore::clazyStandaloneExecutable(CLANG_BINDIR);
|
||||
if (shippedExecutable.isExecutableFile())
|
||||
return shippedExecutable;
|
||||
return {};
|
||||
}
|
||||
|
||||
QString fullPath(const QString &executable)
|
||||
FilePath fullPath(const FilePath &executable)
|
||||
{
|
||||
const QString hostExeSuffix = QLatin1String(QTC_HOST_EXE_SUFFIX);
|
||||
const Qt::CaseSensitivity caseSensitivity = Utils::HostOsInfo::fileNameCaseSensitivity();
|
||||
|
||||
QString candidate = executable;
|
||||
const bool hasSuffix = candidate.endsWith(hostExeSuffix, caseSensitivity);
|
||||
FilePath candidate = executable;
|
||||
const bool hasSuffix = candidate.toString().endsWith(hostExeSuffix, caseSensitivity);
|
||||
|
||||
const QFileInfo fileInfo = QFileInfo(candidate);
|
||||
if (fileInfo.isAbsolute()) {
|
||||
if (candidate.isAbsolutePath()) {
|
||||
if (!hasSuffix)
|
||||
candidate.append(hostExeSuffix);
|
||||
candidate = candidate.withExecutableSuffix();
|
||||
} else {
|
||||
const Utils::Environment environment = Utils::Environment::systemEnvironment();
|
||||
const QString expandedPath = environment.searchInPath(candidate).toString();
|
||||
const Environment environment = Environment::systemEnvironment();
|
||||
const FilePath expandedPath = environment.searchInPath(candidate.toString());
|
||||
if (!expandedPath.isEmpty())
|
||||
candidate = expandedPath;
|
||||
}
|
||||
@@ -217,18 +209,18 @@ QString fullPath(const QString &executable)
|
||||
return candidate;
|
||||
}
|
||||
|
||||
static QString findValidExecutable(const QStringList &candidates)
|
||||
static FilePath findValidExecutable(const FilePaths &candidates)
|
||||
{
|
||||
for (const QString &candidate : candidates) {
|
||||
const QString expandedPath = fullPath(candidate);
|
||||
if (isFileExecutable(expandedPath))
|
||||
for (const FilePath &candidate : candidates) {
|
||||
const FilePath expandedPath = fullPath(candidate);
|
||||
if (expandedPath.isExecutableFile())
|
||||
return expandedPath;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
QString clangTidyFallbackExecutable()
|
||||
FilePath clangTidyFallbackExecutable()
|
||||
{
|
||||
return findValidExecutable({
|
||||
shippedClangTidyExecutable(),
|
||||
@@ -236,15 +228,15 @@ QString clangTidyFallbackExecutable()
|
||||
});
|
||||
}
|
||||
|
||||
QString clangTidyExecutable()
|
||||
FilePath clangTidyExecutable()
|
||||
{
|
||||
const QString fromSettings = ClangToolsSettings::instance()->clangTidyExecutable();
|
||||
const FilePath fromSettings = ClangToolsSettings::instance()->clangTidyExecutable();
|
||||
if (!fromSettings.isEmpty())
|
||||
return fullPath(fromSettings);
|
||||
return clangTidyFallbackExecutable();
|
||||
}
|
||||
|
||||
QString clazyStandaloneFallbackExecutable()
|
||||
FilePath clazyStandaloneFallbackExecutable()
|
||||
{
|
||||
return findValidExecutable({
|
||||
shippedClazyStandaloneExecutable(),
|
||||
@@ -252,9 +244,9 @@ QString clazyStandaloneFallbackExecutable()
|
||||
});
|
||||
}
|
||||
|
||||
QString clazyStandaloneExecutable()
|
||||
FilePath clazyStandaloneExecutable()
|
||||
{
|
||||
const QString fromSettings = ClangToolsSettings::instance()->clazyStandaloneExecutable();
|
||||
const FilePath fromSettings = ClangToolsSettings::instance()->clazyStandaloneExecutable();
|
||||
if (!fromSettings.isEmpty())
|
||||
return fullPath(fromSettings);
|
||||
return clazyStandaloneFallbackExecutable();
|
||||
|
||||
@@ -32,12 +32,9 @@
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QString;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace CppTools { class ClangDiagnosticConfigsModel; }
|
||||
namespace Debugger { class DiagnosticLocation; }
|
||||
namespace Utils { class FilePath; }
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
@@ -68,17 +65,15 @@ QString createFullLocationString(const Debugger::DiagnosticLocation &location);
|
||||
QString hintAboutBuildBeforeAnalysis();
|
||||
void showHintAboutBuildBeforeAnalysis();
|
||||
|
||||
bool isFileExecutable(const QString &filePath);
|
||||
Utils::FilePath shippedClazyStandaloneExecutable();
|
||||
Utils::FilePath clazyStandaloneExecutable();
|
||||
Utils::FilePath clazyStandaloneFallbackExecutable();
|
||||
|
||||
QString shippedClazyStandaloneExecutable();
|
||||
QString clazyStandaloneExecutable();
|
||||
QString clazyStandaloneFallbackExecutable();
|
||||
Utils::FilePath shippedClangTidyExecutable();
|
||||
Utils::FilePath clangTidyExecutable();
|
||||
Utils::FilePath clangTidyFallbackExecutable();
|
||||
|
||||
QString shippedClangTidyExecutable();
|
||||
QString clangTidyExecutable();
|
||||
QString clangTidyFallbackExecutable();
|
||||
|
||||
QString fullPath(const QString &executable);
|
||||
Utils::FilePath fullPath(const Utils::FilePath &executable);
|
||||
|
||||
QString documentationUrl(const QString &checkName);
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ void DocumentClangToolRunner::run()
|
||||
QPair<Utils::FilePath, QString> getClangIncludeDirAndVersion(ClangToolRunner *runner)
|
||||
{
|
||||
static QMap<Utils::FilePath, QPair<Utils::FilePath, QString>> cache;
|
||||
const Utils::FilePath tool = Utils::FilePath::fromString(runner->executable());
|
||||
const Utils::FilePath tool = runner->executable();
|
||||
auto it = cache.find(tool);
|
||||
if (it == cache.end())
|
||||
it = cache.insert(tool, getClangIncludeDirAndVersion(tool));
|
||||
|
||||
@@ -158,17 +158,16 @@ static ClazyChecks querySupportedClazyChecks(const FilePath &executablePath)
|
||||
return infos;
|
||||
}
|
||||
|
||||
ClangTidyInfo::ClangTidyInfo(const QString &executablePath)
|
||||
: defaultChecks(queryClangTidyChecks(FilePath::fromString(executablePath), {}))
|
||||
, supportedChecks(queryClangTidyChecks(FilePath::fromString(executablePath), "-checks=*"))
|
||||
ClangTidyInfo::ClangTidyInfo(const FilePath &executablePath)
|
||||
: defaultChecks(queryClangTidyChecks(executablePath, {}))
|
||||
, supportedChecks(queryClangTidyChecks(executablePath, "-checks=*"))
|
||||
{}
|
||||
|
||||
ClazyStandaloneInfo::ClazyStandaloneInfo(const QString &executablePath)
|
||||
: defaultChecks(queryClangTidyChecks(FilePath::fromString(executablePath), {})) // Yup, behaves as clang-tidy.
|
||||
, supportedChecks(querySupportedClazyChecks(FilePath::fromString(executablePath)))
|
||||
ClazyStandaloneInfo::ClazyStandaloneInfo(const FilePath &executablePath)
|
||||
: defaultChecks(queryClangTidyChecks(executablePath, {})) // Yup, behaves as clang-tidy.
|
||||
, supportedChecks(querySupportedClazyChecks(executablePath))
|
||||
{
|
||||
QString output = runExecutable(CommandLine(FilePath::fromString(executablePath), {"--version"}),
|
||||
QueryFailMode::Silent);
|
||||
QString output = runExecutable({executablePath, {"--version"}}, QueryFailMode::Silent);
|
||||
QTextStream stream(&output);
|
||||
while (!stream.atEnd()) {
|
||||
// It's just "clazy version " right now, but let's be prepared for someone adding a colon
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/filepath.h>
|
||||
|
||||
#include <QPair>
|
||||
#include <QStringList>
|
||||
@@ -43,7 +43,7 @@ QString queryVersion(const Utils::FilePath &clangToolPath, QueryFailMode failMod
|
||||
class ClangTidyInfo
|
||||
{
|
||||
public:
|
||||
ClangTidyInfo(const QString &executablePath);
|
||||
ClangTidyInfo(const Utils::FilePath &executablePath);
|
||||
QStringList defaultChecks;
|
||||
QStringList supportedChecks;
|
||||
};
|
||||
@@ -60,7 +60,7 @@ using ClazyChecks = QVector<ClazyCheck>;
|
||||
class ClazyStandaloneInfo
|
||||
{
|
||||
public:
|
||||
ClazyStandaloneInfo(const QString &executablePath);
|
||||
ClazyStandaloneInfo(const Utils::FilePath &executablePath);
|
||||
|
||||
QVersionNumber version;
|
||||
QStringList defaultChecks;
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
#include <QThread>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
@@ -60,8 +62,8 @@ static CppTools::ClangDiagnosticConfigsWidget *createEditWidget(
|
||||
const CppTools::ClangDiagnosticConfigs &configs, const Utils::Id &configToSelect)
|
||||
{
|
||||
// Determine executable paths
|
||||
QString clangTidyPath;
|
||||
QString clazyStandalonePath;
|
||||
FilePath clangTidyPath;
|
||||
FilePath clazyStandalonePath;
|
||||
if (auto settingsWidget = SettingsWidget::instance()) {
|
||||
// Global settings case; executables might not yet applied to settings
|
||||
clangTidyPath = settingsWidget->clangTidyPath();
|
||||
|
||||
@@ -37,20 +37,22 @@
|
||||
|
||||
#include <utils/optional.h>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
static SettingsWidget *m_instance = nullptr;
|
||||
|
||||
static void setupPathChooser(Utils::PathChooser *const chooser,
|
||||
static void setupPathChooser(PathChooser *const chooser,
|
||||
const QString &promptDiaglogTitle,
|
||||
const QString &placeHolderText,
|
||||
const QString &pathFromSettings,
|
||||
const FilePath &pathFromSettings,
|
||||
const QString &historyCompleterId)
|
||||
{
|
||||
chooser->setPromptDialogTitle(promptDiaglogTitle);
|
||||
chooser->setDefaultValue(placeHolderText);
|
||||
chooser->setPath(pathFromSettings);
|
||||
chooser->setFilePath(pathFromSettings);
|
||||
chooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
||||
chooser->setHistoryCompleter(historyCompleterId);
|
||||
}
|
||||
@@ -71,8 +73,8 @@ SettingsWidget::SettingsWidget()
|
||||
// Group box "Executables"
|
||||
//
|
||||
|
||||
QString placeHolderText = shippedClangTidyExecutable();
|
||||
QString path = m_settings->clangTidyExecutable();
|
||||
QString placeHolderText = shippedClangTidyExecutable().toUserOutput();
|
||||
FilePath path = m_settings->clangTidyExecutable();
|
||||
if (path.isEmpty() && placeHolderText.isEmpty())
|
||||
path = Constants::CLANG_TIDY_EXECUTABLE_NAME;
|
||||
setupPathChooser(m_ui->clangTidyPathChooser,
|
||||
@@ -81,7 +83,7 @@ SettingsWidget::SettingsWidget()
|
||||
path,
|
||||
"ClangTools.ClangTidyExecutable.History");
|
||||
|
||||
placeHolderText = shippedClazyStandaloneExecutable();
|
||||
placeHolderText = shippedClazyStandaloneExecutable().toUserOutput();
|
||||
path = m_settings->clazyStandaloneExecutable();
|
||||
if (path.isEmpty() && placeHolderText.isEmpty())
|
||||
path = Constants::CLAZY_STANDALONE_EXECUTABLE_NAME;
|
||||
@@ -101,8 +103,8 @@ SettingsWidget::SettingsWidget()
|
||||
void SettingsWidget::apply()
|
||||
{
|
||||
// Executables
|
||||
m_settings->setClangTidyExecutable(m_ui->clangTidyPathChooser->rawPath());
|
||||
m_settings->setClazyStandaloneExecutable(m_ui->clazyStandalonePathChooser->rawPath());
|
||||
m_settings->setClangTidyExecutable(clangTidyPath());
|
||||
m_settings->setClazyStandaloneExecutable(clazyStandalonePath());
|
||||
|
||||
// Run options
|
||||
m_settings->setRunSettings(m_ui->runSettingsWidget->toSettings());
|
||||
@@ -120,14 +122,14 @@ SettingsWidget::~SettingsWidget()
|
||||
m_instance = nullptr;
|
||||
}
|
||||
|
||||
QString SettingsWidget::clangTidyPath() const
|
||||
FilePath SettingsWidget::clangTidyPath() const
|
||||
{
|
||||
return m_ui->clangTidyPathChooser->rawPath();
|
||||
return m_ui->clangTidyPathChooser->rawFilePath();
|
||||
}
|
||||
|
||||
QString SettingsWidget::clazyStandalonePath() const
|
||||
FilePath SettingsWidget::clazyStandalonePath() const
|
||||
{
|
||||
return m_ui->clazyStandalonePathChooser->rawPath();
|
||||
return m_ui->clazyStandalonePathChooser->rawFilePath();
|
||||
}
|
||||
|
||||
// ClangToolsOptionsPage
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Utils { class FilePath; }
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
|
||||
@@ -46,8 +48,8 @@ public:
|
||||
SettingsWidget();
|
||||
~SettingsWidget() override;
|
||||
|
||||
QString clangTidyPath() const;
|
||||
QString clazyStandalonePath() const;
|
||||
Utils::FilePath clangTidyPath() const;
|
||||
Utils::FilePath clazyStandalonePath() const;
|
||||
|
||||
private:
|
||||
void apply() final;
|
||||
|
||||
Reference in New Issue
Block a user