]> git.mxchange.org Git - flightgear.git/commitdiff
Launcher: silence 'Unknown aircraft URI scheme' warning on empty selection
authorAlessandro Menti <alessandro.menti@hotmail.it>
Thu, 14 Apr 2016 14:41:19 +0000 (16:41 +0200)
committerJames Turner <zakalawe@mac.com>
Sun, 17 Apr 2016 16:55:05 +0000 (17:55 +0100)
------------------------------------------------------------------------
If no aircraft is selected in the launcher, the routine
AircraftItemModel::indexOfAircraftURI is called with an empty QUri,
triggering a warning in the terminal.

This commit removes such warning by ignoring QUris with empty schemes
(the routine still returns an invalid index).

src/GUI/AircraftModel.cxx

index b4fe7f6753e7b127d65014fd59dce91d6d4558df..5783a1237254f15a3f773feba947a1be5f117dae 100644 (file)
@@ -862,6 +862,8 @@ QModelIndex AircraftItemModel::indexOfAircraftURI(QUrl uri) const
                 }
             } // of linear package scan
         }
+    } else if (uri.scheme() == "") {
+        // Empty URI scheme (no selection), nothing to do
     } else {
         qWarning() << "Unknown aircraft URI scheme" << uri << uri.scheme();
     }