Android: Remove AndroidRunnable::{beforeStart,afterFinish}AdbCommands

We have nowadays two ways to pass data from run configurations to
tool that do not require intimate knowledge of the sender:

1. Using RunConfigurationAspects, accessible for all workers in a
   RunControl
2. Using RunWorker::recordData for an individual worker.

This removes the need to use specific fields in a runnable and
means that a tool plugin can be better separated from target plugins.

The approaches are not mutually exclusive, both use an string-ish
id, I chose here to use the same string when using both.

This patch here uses approach 2. for the GammaRay/Android combo.
It also fixes a (harmless) typo (s/POSTSTART/POSTFINISH).

Change-Id: I4048693ca73b17253a39bfcacc9e1880ecf25736
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
hjk
2018-05-15 12:11:54 +02:00
parent 64d601def3
commit 099f8c7e80
6 changed files with 34 additions and 31 deletions

View File

@@ -111,20 +111,20 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id)
{
auto amStartArgsAspect = new BaseStringAspect(this);
amStartArgsAspect->setId(Constants::ANDROID_AMSTARTARGS_ASPECT);
amStartArgsAspect->setId(Constants::ANDROID_AMSTARTARGS);
amStartArgsAspect->setSettingsKey("Android.AmStartArgsKey");
amStartArgsAspect->setLabelText(tr("Activity manager start options:"));
amStartArgsAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);
addExtraAspect(amStartArgsAspect);
auto preStartShellCmdAspect = new BaseStringListAspect(this);
preStartShellCmdAspect->setId(Constants::ANDROID_PRESTARTSHELLCMDLIST_ASPECT);
preStartShellCmdAspect->setId(Constants::ANDROID_PRESTARTSHELLCMDLIST);
preStartShellCmdAspect->setSettingsKey("Android.PreStartShellCmdListKey");
preStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device before application launch."));
addExtraAspect(preStartShellCmdAspect);
auto postStartShellCmdAspect = new BaseStringListAspect(this);
postStartShellCmdAspect->setId(Constants::ANDROID_POSTSTARTSHELLCMDLIST_ASPECT);
postStartShellCmdAspect->setId(Constants::ANDROID_POSTFINISHSHELLCMDLIST);
postStartShellCmdAspect->setSettingsKey("Android.PostStartShellCmdListKey");
postStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device after application quits."));
addExtraAspect(postStartShellCmdAspect);
@@ -140,7 +140,7 @@ QWidget *AndroidRunConfiguration::createConfigurationWidget()
auto widget = new QWidget;
auto layout = new QFormLayout(widget);
extraAspect(Constants::ANDROID_AMSTARTARGS_ASPECT)->addToConfigurationLayout(layout);
extraAspect(Constants::ANDROID_AMSTARTARGS)->addToConfigurationLayout(layout);
auto warningIconLabel = new QLabel;
warningIconLabel->setPixmap(Utils::Icons::WARNING.pixmap());
@@ -148,8 +148,8 @@ QWidget *AndroidRunConfiguration::createConfigurationWidget()
auto warningLabel = new QLabel(tr("If the \"am start\" options conflict, the application might not start."));
layout->addRow(warningIconLabel, warningLabel);
extraAspect(Constants::ANDROID_PRESTARTSHELLCMDLIST_ASPECT)->addToConfigurationLayout(layout);
extraAspect(Constants::ANDROID_POSTSTARTSHELLCMDLIST_ASPECT)->addToConfigurationLayout(layout);
extraAspect(Constants::ANDROID_PRESTARTSHELLCMDLIST)->addToConfigurationLayout(layout);
extraAspect(Constants::ANDROID_POSTFINISHSHELLCMDLIST)->addToConfigurationLayout(layout);
auto wrapped = wrapWidget(widget);
auto detailsWidget = qobject_cast<DetailsWidget *>(wrapped);