Commit 7e3cf7c7 authored by Patrick José Pereira's avatar Patrick José Pereira

AutoPilotPlugins: Change from foreach to c++11 for

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent a2f23a26
...@@ -33,7 +33,7 @@ void AutoPilotPlugin::_recalcSetupComplete(void) ...@@ -33,7 +33,7 @@ void AutoPilotPlugin::_recalcSetupComplete(void)
{ {
bool newSetupComplete = true; bool newSetupComplete = true;
foreach(const QVariant componentVariant, vehicleComponents()) { for(const QVariant componentVariant: vehicleComponents()) {
VehicleComponent* component = qobject_cast<VehicleComponent*>(qvariant_cast<QObject *>(componentVariant)); VehicleComponent* component = qobject_cast<VehicleComponent*>(qvariant_cast<QObject *>(componentVariant));
if (component) { if (component) {
if (!component->setupComplete()) { if (!component->setupComplete()) {
...@@ -61,7 +61,7 @@ void AutoPilotPlugin::parametersReadyPreChecks(void) ...@@ -61,7 +61,7 @@ void AutoPilotPlugin::parametersReadyPreChecks(void)
_recalcSetupComplete(); _recalcSetupComplete();
// Connect signals in order to keep setupComplete up to date // Connect signals in order to keep setupComplete up to date
foreach(const QVariant componentVariant, vehicleComponents()) { for(const QVariant componentVariant: vehicleComponents()) {
VehicleComponent* component = qobject_cast<VehicleComponent*>(qvariant_cast<QObject *>(componentVariant)); VehicleComponent* component = qobject_cast<VehicleComponent*>(qvariant_cast<QObject *>(componentVariant));
if (component) { if (component) {
connect(component, &VehicleComponent::setupCompleteChanged, this, &AutoPilotPlugin::_recalcSetupComplete); connect(component, &VehicleComponent::setupCompleteChanged, this, &AutoPilotPlugin::_recalcSetupComplete);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment