Commit 35629fb7 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

project clazy tool: Fix clazy plugin in case build dir is outside of source

The build dir was checked instead of the path variants defined above.
Also use QDir::filePath to make it a bit simpler.
parent 93d8c2a1
...@@ -141,13 +141,11 @@ QString KateProjectCodeAnalysisToolClazy::compileCommandsDirectory() const ...@@ -141,13 +141,11 @@ QString KateProjectCodeAnalysisToolClazy::compileCommandsDirectory() const
* Check all paths one by one for compile_commands.json and exit when found * Check all paths one by one for compile_commands.json and exit when found
*/ */
QString compileCommandsDir; QString compileCommandsDir;
for (QString path : possiblePaths) { for (const QString &path : possiblePaths) {
if (!path.endsWith(QLatin1Char('/'))) { const QString guessedPath = QDir(path).filePath(compCommandsFile);
path.append(QLatin1Char('/')); const bool dirHasCompileComds = QFile::exists(guessedPath);
}
const bool dirHasCompileComds = QFile::exists(buildDir + compCommandsFile);
if (dirHasCompileComds) { if (dirHasCompileComds) {
compileCommandsDir = path; compileCommandsDir = guessedPath;
break; break;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment