Unverified Commit 7f958639 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #7074 from DonLakeFlyer/MissionControllerDirty

Plane: Fix handling of dirty bit when home position changes from vehicle side
parents 4509f4b1 e8b9fd7a
......@@ -1714,15 +1714,20 @@ void MissionController::managerVehicleChanged(Vehicle* managerVehicle)
void MissionController::_managerVehicleHomePositionChanged(const QGeoCoordinate& homePosition)
{
if (_visualItems) {
bool currentDirtyBit = dirty();
MissionSettingsItem* settingsItem = qobject_cast<MissionSettingsItem*>(_visualItems->get(0));
if (settingsItem) {
settingsItem->setHomePositionFromVehicle(homePosition);
} else {
qWarning() << "First item is not MissionSettingsItem";
}
// Don't let this trip the dirty bit. Otherwise plan will keep getting marked dirty if vehicle home
// changes.
_visualItems->setDirty(false);
if (!currentDirtyBit) {
// Don't let this trip the dirty bit. Otherwise plan will keep getting marked dirty if vehicle home
// changes.
_visualItems->setDirty(false);
}
}
}
......
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