Commit 4d28975d authored by Don Gagne's avatar Don Gagne

Don't emit useless signal

parent 7fee54b9
...@@ -149,15 +149,17 @@ void MultiVehicleManager::_deleteVehiclePhase2 (void) ...@@ -149,15 +149,17 @@ void MultiVehicleManager::_deleteVehiclePhase2 (void)
void MultiVehicleManager::setActiveVehicle(Vehicle* vehicle) void MultiVehicleManager::setActiveVehicle(Vehicle* vehicle)
{ {
if (vehicle != _activeVehicle) { if (vehicle != _activeVehicle) {
// The sequence of signals is very important in order to not leave Qml elements connected if (_activeVehicle) {
// to a non-existent vehicle. // The sequence of signals is very important in order to not leave Qml elements connected
// to a non-existent vehicle.
// First we must signal that there is no active vehicle available. This will disconnect
// any existing ui from the currently active vehicle. // First we must signal that there is no active vehicle available. This will disconnect
_activeVehicleAvailable = false; // any existing ui from the currently active vehicle.
_parameterReadyVehicleAvailable = false; _activeVehicleAvailable = false;
emit activeVehicleAvailableChanged(false); _parameterReadyVehicleAvailable = false;
emit parameterReadyVehicleAvailableChanged(false); emit activeVehicleAvailableChanged(false);
emit parameterReadyVehicleAvailableChanged(false);
}
// See explanation in _deleteVehiclePhase1 // See explanation in _deleteVehiclePhase1
_vehicleBeingSetActive = vehicle; _vehicleBeingSetActive = vehicle;
......
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