]> git.mxchange.org Git - flightgear.git/commitdiff
Bugfix: Qt launcher, enable variant aircraft on-disk
authorJames Turner <zakalawe@mac.com>
Sat, 5 Mar 2016 09:34:16 +0000 (09:34 +0000)
committerJames Turner <zakalawe@mac.com>
Sat, 5 Mar 2016 09:34:16 +0000 (09:34 +0000)
When mapping a URI to a QModelIndex, we were only considering the
primary aircraft path, for on-disk aircraft as opposed to packages.

src/GUI/AircraftModel.cxx

index 2871da8e06a95ce74f4a8a9fc8f785793d015a66..16e015c7c34604ceaa4504099310ccff5489bf38 100644 (file)
@@ -756,6 +756,13 @@ QModelIndex AircraftItemModel::indexOfAircraftURI(QUrl uri) const
             if (item->path == path) {
                 return index(row);
             }
+
+            // check variants too
+            for (int vr=0; vr < item->variants.size(); ++vr) {
+                if (item->variants.at(vr)->path == path) {
+                    return index(row);
+                }
+            }
         }
     } else if (uri.scheme() == "package") {
         QString ident = uri.path();