Android: Use new runconfiguration aspect update mechanism

Change-Id: I2a05f212cbba4471d66be9537b604b4e5abbc0de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-11-25 16:57:48 +01:00
parent 572af85224
commit 6cc1519964
2 changed files with 7 additions and 13 deletions

View File

@@ -133,10 +133,14 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id)
postStartShellCmdAspect->setSettingsKey("Android.PostStartShellCmdListKey"); postStartShellCmdAspect->setSettingsKey("Android.PostStartShellCmdListKey");
postStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device after application quits.")); postStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device after application quits."));
connect(target, &Target::buildSystemUpdated, this, [this] { setUpdater([this, target] {
updateTargetInformation(); const BuildTargetInfo bti = buildTargetInfo();
AndroidManager::updateGradleProperties(this->target(), buildKey()); setDisplayName(bti.displayName);
setDefaultDisplayName(bti.displayName);
AndroidManager::updateGradleProperties(target, buildKey());
}); });
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
} }
QWidget *AndroidRunConfiguration::createConfigurationWidget() QWidget *AndroidRunConfiguration::createConfigurationWidget()
@@ -149,11 +153,4 @@ QWidget *AndroidRunConfiguration::createConfigurationWidget()
return detailsWidget; return detailsWidget;
} }
void AndroidRunConfiguration::updateTargetInformation()
{
const BuildTargetInfo bti = buildTargetInfo();
setDisplayName(bti.displayName);
setDefaultDisplayName(bti.displayName);
}
} // namespace Android } // namespace Android

View File

@@ -69,9 +69,6 @@ public:
explicit AndroidRunConfiguration(ProjectExplorer::Target *target, Core::Id id); explicit AndroidRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
QWidget *createConfigurationWidget() override; QWidget *createConfigurationWidget() override;
private:
void updateTargetInformation();
}; };
} // namespace Android } // namespace Android