]> git.mxchange.org Git - flightgear.git/commitdiff
Fallback when aircraft description is missing.
authorJames Turner <zakalawe@mac.com>
Sat, 26 Sep 2015 17:41:32 +0000 (12:41 -0500)
committerJames Turner <zakalawe@mac.com>
Mon, 23 Nov 2015 00:47:01 +0000 (00:47 +0000)
- avoids corrupted delegate display caused by asking for
  bounds of empty string.

src/GUI/AircraftModel.cxx

index 2b424e5d7cb40df15583e5e21f5fab2c6f5878cc..56a5c64c63938c3db0ef3f83482392c4c914e4e0 100644 (file)
@@ -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();