CMake: use FilePaths to generate relative source entries

Change-Id: I5df67517e269d650166f72a625e5835e780fca9d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
David Schulz
2021-09-13 14:38:44 +02:00
parent 4aea533fe5
commit 3369948b1a

View File

@@ -81,10 +81,9 @@ static void copySourcePathsToClipboard(const FilePaths &srcPaths, const ProjectN
{
QClipboard *clip = QGuiApplication::clipboard();
QDir projDir{node->filePath().toFileInfo().absoluteFilePath()};
QString data = Utils::transform(srcPaths, [projDir](const FilePath &path) {
return QDir::cleanPath(projDir.relativeFilePath(path.toString()));
}).join(" ");
QString data = Utils::transform(srcPaths, [projDir = node->filePath()](const FilePath &path) {
return path.relativePath(projDir).cleanPath().toString();
}).join(" ");
clip->setText(data);
}