Commit f78ed772 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Prevent double request of mission items (#3692)

parent 2e9d1120
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "SimpleMissionItem.h" #include "SimpleMissionItem.h"
#include "ComplexMissionItem.h" #include "ComplexMissionItem.h"
#include "JsonHelper.h" #include "JsonHelper.h"
#include "ParameterLoader.h"
#ifndef __mobile__ #ifndef __mobile__
#include "QGCFileDialog.h" #include "QGCFileDialog.h"
...@@ -963,8 +964,9 @@ void MissionController::_activeVehicleChanged(Vehicle* activeVehicle) ...@@ -963,8 +964,9 @@ void MissionController::_activeVehicleChanged(Vehicle* activeVehicle)
connect(_activeVehicle, &Vehicle::homePositionAvailableChanged, this, &MissionController::_activeVehicleHomePositionAvailableChanged); connect(_activeVehicle, &Vehicle::homePositionAvailableChanged, this, &MissionController::_activeVehicleHomePositionAvailableChanged);
connect(_activeVehicle, &Vehicle::homePositionChanged, this, &MissionController::_activeVehicleHomePositionChanged); connect(_activeVehicle, &Vehicle::homePositionChanged, this, &MissionController::_activeVehicleHomePositionChanged);
if (!syncInProgress()) { if (_activeVehicle->getParameterLoader()->parametersAreReady() && !syncInProgress()) {
// We have to manually ask for the items from the Vehicle // We are switching between two previously existing vehicles. We have to manually ask for the items from the Vehicle.
// We don't request mission items for new vehicles since that will happen autamatically.
getMissionItems(); getMissionItems();
} }
......
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