Commit dc9f5999 authored by Daniel Teske's avatar Daniel Teske
Browse files

GenericProject: Use Utils::FileName for childOf check



Using startsWith is wrong

Change-Id: Ib54c62006994e0657576845066ce8ba9d15d2138
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 0a1bdf42
......@@ -94,14 +94,14 @@ void GenericProjectNode::refresh()
foreach (const QString &absoluteFileName, files) {
QFileInfo fileInfo(absoluteFileName);
const QString absoluteFilePath = fileInfo.path();
Utils::FileName absoluteFilePath = Utils::FileName::fromString(fileInfo.path());
QString relativeFilePath;
if (absoluteFilePath.startsWith(base)) {
relativeFilePath = absoluteFilePath.mid(base.length() + 1);
if (absoluteFilePath.isChildOf(baseDir)) {
relativeFilePath = absoluteFilePath.relativeChildPath(Utils::FileName::fromString(base)).toString();
} else {
// `file' is not part of the project.
relativeFilePath = baseDir.relativeFilePath(absoluteFilePath);
relativeFilePath = baseDir.relativeFilePath(absoluteFilePath.toString());
}
if (! filePaths.contains(relativeFilePath))
......
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