From c6e64bcd92e02511677aa52b3cc941f68dc66f94 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 31 Jul 2015 23:37:10 +0200 Subject: [PATCH] Autopilot airframe plugin: Always offer a valid image --- src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc b/src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc index b282785..fc34558 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc +++ b/src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc @@ -57,7 +57,11 @@ void AirframeComponentAirframes::insert(QString& group, QString& image, QString& if (!rgAirframeTypes.contains(group)) { g = new AirframeType_t; g->name = group; - g->imageResource = QString("qrc:/qmlimages/").append(image); + if (image.length() > 0) { + g->imageResource = QString("qrc:/qmlimages/").append(image); + } else { + g->imageResource = QString("qrc:/qmlimages/AirframeStandardPlane.png"); + } qDebug() << "IMAGE:" << g->imageResource; rgAirframeTypes.insert(group, g); } else {