From: James Turner Date: Sat, 26 Sep 2015 17:41:32 +0000 (-0500) Subject: Fallback when aircraft description is missing. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ceebd59001cdae2ec10e72ef713c8db698c8dd33;p=flightgear.git Fallback when aircraft description is missing. - avoids corrupted delegate display caused by asking for bounds of empty string. --- diff --git a/src/GUI/AircraftModel.cxx b/src/GUI/AircraftModel.cxx index 2b424e5d7..56a5c64c6 100644 --- a/src/GUI/AircraftModel.cxx +++ b/src/GUI/AircraftModel.cxx @@ -528,6 +528,10 @@ QVariant AircraftItemModel::dataFromItem(AircraftItemPtr item, quint32 variantIn } if (role == Qt::DisplayRole) { + if (item->description.isEmpty()) { + return tr("Missing description for: %1").arg(item->baseName()); + } + return item->description; } else if (role == Qt::DecorationRole) { return item->thumbnail();