Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 4.9.0
-
None
-
-
443d8e4713d4c0a2d4d8a8dc0341910500c943b5 (qt-creator/qt-creator/master)
Description
The include path processing for the Compilation Database plugin includes the following code:
if (!QDir(pathStr).exists() && QDir(workingDir + "/" + pathStr).exists()) { result = workingDir + "/" + pathStr; }
The project I'm currently working with includes an include path (among others) of -I../.., which obviously exists almost anywhere in the file system, and thus the if block is skipped. This is wrong, however, as the path should definitely be interpreted relative to the working directory (which seems like it would always be the case for relative paths).
Is there any reason not to do something like this, instead?
if (!QDir(pathStr).isAbsolute()) {
result = workingDir + "/" + pathStr;
}
It seems to work for me, but I don't know the reasoning behind the initial version.