ProjectExplorer: Simplify use of AbstractProcessStep::init()

1. Systematically check for AbstractProcessStep::init() first in
   derived classes.
2. Use setupProcessParameters(processParameters()); by default in
   the base implementation.
3. Drop all re-implementations that are effectively the same.

Change-Id: I0ae54dd4909b354672a63ee56d0b7c2ea0732494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-09-14 17:17:55 +02:00
parent 9f378d41e4
commit 0d185a0ad3
23 changed files with 47 additions and 136 deletions

View File

@@ -499,6 +499,9 @@ AndroidBuildApkStep::AndroidBuildApkStep(BuildStepList *parent, Utils::Id id)
bool AndroidBuildApkStep::init()
{
if (!AbstractProcessStep::init())
return false;
if (m_signPackage) {
qCDebug(buildapkstepLog) << "Signing enabled";
// check keystore and certificate passwords
@@ -566,9 +569,6 @@ bool AndroidBuildApkStep::init()
qCDebug(buildapkstepLog) << "APK or AAB path:" << m_packagePath;
if (!AbstractProcessStep::init())
return false;
QString command = version->hostBinPath().toString();
if (!command.endsWith('/'))
command += '/';
@@ -631,9 +631,7 @@ bool AndroidBuildApkStep::init()
arguments << "--no-gdbserver";
}
ProjectExplorer::ProcessParameters *pp = processParameters();
setupProcessParameters(pp);
pp->setCommandLine({command, arguments});
processParameters()->setCommandLine({command, arguments});
// Generate arguments with keystore password concealed
ProjectExplorer::ProcessParameters pp2;