Core: filepathify file renaming

Change-Id: I3d4f39e34e65cde3df7b7c19570e3a54d0625d53
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
David Schulz
2021-06-11 14:34:34 +02:00
parent 55b91a7617
commit f66df921d7
32 changed files with 203 additions and 176 deletions

View File

@@ -264,24 +264,28 @@ bool QmakeBuildSystem::deleteFiles(Node *context, const QStringList &filePaths)
return BuildSystem::deleteFiles(context, filePaths);
}
bool QmakeBuildSystem::canRenameFile(Node *context, const QString &filePath, const QString &newFilePath)
bool QmakeBuildSystem::canRenameFile(Node *context,
const FilePath &oldFilePath,
const FilePath &newFilePath)
{
if (auto n = dynamic_cast<QmakePriFileNode *>(context)) {
QmakePriFile *pri = n->priFile();
return pri ? pri->canRenameFile(filePath, newFilePath) : false;
return pri ? pri->canRenameFile(oldFilePath, newFilePath) : false;
}
return BuildSystem::canRenameFile(context, filePath, newFilePath);
return BuildSystem::canRenameFile(context, oldFilePath, newFilePath);
}
bool QmakeBuildSystem::renameFile(Node *context, const QString &filePath, const QString &newFilePath)
bool QmakeBuildSystem::renameFile(Node *context,
const FilePath &oldFilePath,
const FilePath &newFilePath)
{
if (auto n = dynamic_cast<QmakePriFileNode *>(context)) {
QmakePriFile *pri = n->priFile();
return pri ? pri->renameFile(filePath, newFilePath) : false;
return pri ? pri->renameFile(oldFilePath, newFilePath) : false;
}
return BuildSystem::renameFile(context, filePath, newFilePath);
return BuildSystem::renameFile(context, oldFilePath, newFilePath);
}
bool QmakeBuildSystem::addDependencies(Node *context, const QStringList &dependencies)