aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2021-08-09 08:53:40 +0200
committerhjk <hjk@qt.io>2021-08-10 07:19:10 +0000
commit2ab2d9675338f5434936b315712539f4b01cd2c6 (patch)
tree4fa4e62f7359dc24df93f4fabbdf5eba1c430c9c /src/plugins/cpptools
parentc179ce867c2ee4d41bd6c7f8acd1874d81cb49d2 (diff)
Utils: Use FilePath in copy helpers
Change-Id: I81b367a5851c0fbcdf45c63c5536c206845a8337 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cpptools')
-rw-r--r--src/plugins/cpptools/cpptoolstestcase.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/cpptools/cpptoolstestcase.cpp b/src/plugins/cpptools/cpptoolstestcase.cpp
index 24e1373f4f..5efe6f8aff 100644
--- a/src/plugins/cpptools/cpptoolstestcase.cpp
+++ b/src/plugins/cpptools/cpptoolstestcase.cpp
@@ -322,20 +322,18 @@ static bool copyRecursively(const QString &sourceDirPath,
const QString &targetDirPath,
QString *error)
{
- auto copyHelper = [](QFileInfo sourceInfo, QFileInfo targetInfo, QString *error) -> bool {
- const QString sourcePath = sourceInfo.absoluteFilePath();
- const QString targetPath = targetInfo.absoluteFilePath();
- if (!QFile::copy(sourcePath, targetPath)) {
+ auto copyHelper = [](const FilePath &sourcePath, const FilePath &targetPath, QString *error) -> bool {
+ if (!sourcePath.copyFile(targetPath)) {
if (error) {
*error = QString::fromLatin1("copyRecursively() failed: \"%1\" to \"%2\".")
- .arg(sourcePath, targetPath);
+ .arg(sourcePath.toUserOutput(), targetPath.toUserOutput());
}
return false;
}
// Copied files from Qt resources are read-only. Make them writable
// so that their parent directory can be removed without warnings.
- QFile file(targetPath);
+ QFile file(targetPath.toString());
return file.setPermissions(file.permissions() | QFile::WriteUser);
};