Android: Replaca a few FilePath::toString() uses

... with more appropriate options.

Change-Id: I47e5c6e629b095cbcb66968352718166f8748daf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-01-24 16:49:45 +01:00
parent b73d6f3be8
commit c93db0feb4

View File

@@ -397,7 +397,7 @@ void AndroidBuildApkWidget::signPackageCheckBoxToggled(bool checked)
void AndroidBuildApkWidget::onOpenSslCheckBoxChanged() void AndroidBuildApkWidget::onOpenSslCheckBoxChanged()
{ {
Utils::FilePath projectPath = appProjectFilePath(); Utils::FilePath projectPath = appProjectFilePath();
QFile projectFile(projectPath.toString()); QFile projectFile(projectPath.toFSPathString());
if (!projectFile.open(QIODevice::ReadWrite | QIODevice::Text)) { if (!projectFile.open(QIODevice::ReadWrite | QIODevice::Text)) {
qWarning() << "Cannot open project file to add OpenSSL extra libs: " << projectPath; qWarning() << "Cannot open project file to add OpenSSL extra libs: " << projectPath;
return; return;
@@ -434,7 +434,7 @@ bool AndroidBuildApkWidget::isOpenSslLibsIncluded()
{ {
Utils::FilePath projectPath = appProjectFilePath(); Utils::FilePath projectPath = appProjectFilePath();
const QString searchStr = openSslIncludeFileContent(projectPath); const QString searchStr = openSslIncludeFileContent(projectPath);
QFile projectFile(projectPath.toString()); QFile projectFile(projectPath.toFSPathString());
projectFile.open(QIODevice::ReadOnly); projectFile.open(QIODevice::ReadOnly);
QTextStream textStream(&projectFile); QTextStream textStream(&projectFile);
QString fileContent = textStream.readAll(); QString fileContent = textStream.readAll();
@@ -564,10 +564,10 @@ bool AndroidBuildApkStep::init()
updateBuildToolsVersionInJsonFile(); updateBuildToolsVersionInJsonFile();
QStringList arguments = {"--input", m_inputFile.toString(), QStringList arguments = {"--input", m_inputFile.path(),
"--output", outputDir.toString(), "--output", outputDir.path(),
"--android-platform", m_buildTargetSdk, "--android-platform", m_buildTargetSdk,
"--jdk", AndroidConfigurations::currentConfig().openJDKLocation().toString()}; "--jdk", AndroidConfigurations::currentConfig().openJDKLocation().path()};
if (m_verbose) if (m_verbose)
arguments << "--verbose"; arguments << "--verbose";
@@ -584,7 +584,7 @@ bool AndroidBuildApkStep::init()
QStringList argumentsPasswordConcealed = arguments; QStringList argumentsPasswordConcealed = arguments;
if (m_signPackage) { if (m_signPackage) {
arguments << "--sign" << m_keystorePath.toString() << m_certificateAlias arguments << "--sign" << m_keystorePath.path() << m_certificateAlias
<< "--storepass" << m_keystorePasswd; << "--storepass" << m_keystorePasswd;
argumentsPasswordConcealed << "--sign" << "******" argumentsPasswordConcealed << "--sign" << "******"
<< "--storepass" << "******"; << "--storepass" << "******";
@@ -650,7 +650,7 @@ bool AndroidBuildApkStep::verifyKeystorePassword()
{ {
if (!m_keystorePath.exists()) { if (!m_keystorePath.exists()) {
reportWarningOrError(Tr::tr("Cannot sign the package. Invalid keystore path (%1).") reportWarningOrError(Tr::tr("Cannot sign the package. Invalid keystore path (%1).")
.arg(m_keystorePath.toString()), Task::Error); .arg(m_keystorePath.toUserOutput()), Task::Error);
return false; return false;
} }