Commit 6f64b236 authored by Nate Weibley's avatar Nate Weibley

Use QGroundControlQmlGlobal::offlineEditingFirmwareType to load offline mission type

Instantiating QSettings on the stack is quite expensive (full file read+parse each time) and this was done in a tight loop with mission items as they were dragged. Very slow.
parent 386b34f6
......@@ -86,12 +86,7 @@ MAV_AUTOPILOT MissionCommands::_firmwareTypeFromVehicle(Vehicle* vehicle) const
if (vehicle) {
return vehicle->firmwareType();
} else {
QSettings settings;
// FIXME: Hack duplicated code from QGroundControlQmlGlobal. Had to do this for now since
// QGroundControlQmlGlobal is not available from C++ side.
return (MAV_AUTOPILOT)settings.value("OfflineEditingFirmwareType", MAV_AUTOPILOT_ARDUPILOTMEGA).toInt();
return (MAV_AUTOPILOT)QGroundControlQmlGlobal::offlineEditingFirmwareType()->rawValue().toInt();
}
}
......
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