Utils: Use multi-arg for strings

Change-Id: I57d87b8f0435c7b304c484ad4d728b59780f212d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-01-10 23:54:26 +01:00
parent ed3d75b044
commit 398b5656b4
5 changed files with 14 additions and 21 deletions

View File

@@ -478,8 +478,7 @@ expected_str<void> DesktopDeviceFileAccess::copyFile(const FilePath &filePath,
if (QFile::copy(filePath.path(), target.path()))
return {};
return make_unexpected(Tr::tr("Failed to copy file \"%1\" to \"%2\".")
.arg(filePath.toUserOutput())
.arg(target.toUserOutput()));
.arg(filePath.toUserOutput(), target.toUserOutput()));
}
bool DesktopDeviceFileAccess::renameFile(const FilePath &filePath, const FilePath &target) const
@@ -811,9 +810,7 @@ expected_str<void> UnixDeviceFileAccess::copyFile(const FilePath &filePath,
if (result.exitCode != 0) {
return make_unexpected(Tr::tr("Failed to copy file \"%1\" to \"%2\": %3")
.arg(filePath.toUserOutput())
.arg(target.toUserOutput())
.arg(QString::fromUtf8(result.stdErr)));
.arg(filePath.toUserOutput(), target.toUserOutput(), QString::fromUtf8(result.stdErr)));
}
return {};
}
@@ -847,8 +844,7 @@ expected_str<QByteArray> UnixDeviceFileAccess::fileContents(const FilePath &file
if (r.exitCode != 0)
return make_unexpected(Tr::tr("Failed reading file \"%1\": %2")
.arg(filePath.toUserOutput())
.arg(QString::fromUtf8(r.stdErr)));
.arg(filePath.toUserOutput(), QString::fromUtf8(r.stdErr)));
return r.stdOut;
}
@@ -866,8 +862,7 @@ expected_str<qint64> UnixDeviceFileAccess::writeFileContents(const FilePath &fil
if (result.exitCode != 0) {
return make_unexpected(Tr::tr("Failed writing file \"%1\": %2")
.arg(filePath.toUserOutput())
.arg(QString::fromUtf8(result.stdErr)));
.arg(filePath.toUserOutput(), QString::fromUtf8(result.stdErr)));
}
return data.size();
}