Utils: Add a code path taking care of cross-device file copies

Not optimal, but will suffice for docker callgrind.

Change-Id: Iac669fe9dd29206df2a4ffc61d659afce2f7a6c4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-08-30 11:37:58 +02:00
parent 61dcac44b8
commit 87b3de0e39

View File

@@ -1307,6 +1307,11 @@ bool FilePath::removeRecursively(QString *error) const
bool FilePath::copyFile(const FilePath &target) const bool FilePath::copyFile(const FilePath &target) const
{ {
if (host() != target.host()) {
// FIXME: This does not scale.
const QByteArray ba = fileContents();
return target.writeFileContents(ba);
}
if (needsDevice()) { if (needsDevice()) {
QTC_ASSERT(s_deviceHooks.copyFile, return false); QTC_ASSERT(s_deviceHooks.copyFile, return false);
return s_deviceHooks.copyFile(*this, target); return s_deviceHooks.copyFile(*this, target);