ClangToolsSettings: Reuse ClangToolType enum

Change-Id: I24d7bde71ccf3fc3ea33b78e0ed629fa0ce90c04
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-01-10 15:51:31 +01:00
parent 7ef8d8313d
commit 0ba3dbf1be
4 changed files with 20 additions and 18 deletions

View File

@@ -174,16 +174,20 @@ void ClangToolsSettings::writeSettings()
emit changed();
}
void ClangToolsSettings::setClangTidyExecutable(const FilePath &path)
FilePath ClangToolsSettings::executable(ClangToolType tool) const
{
m_clangTidyExecutable = path;
m_clangTidyVersion = {};
return tool == ClangToolType::Tidy ? m_clangTidyExecutable : m_clazyStandaloneExecutable;
}
void ClangToolsSettings::setClazyStandaloneExecutable(const FilePath &path)
void ClangToolsSettings::setExecutable(ClangToolType tool, const FilePath &path)
{
m_clazyStandaloneExecutable = path;
m_clazyVersion = {};
if (tool == ClangToolType::Tidy) {
m_clangTidyExecutable = path;
m_clangTidyVersion = {};
} else {
m_clazyStandaloneExecutable = path;
m_clazyVersion = {};
}
}
static VersionAndSuffix getVersionNumber(VersionAndSuffix &version, const FilePath &toolFilePath)