From: Alessandro Menti Date: Thu, 14 Apr 2016 14:41:19 +0000 (+0200) Subject: Launcher: silence 'Unknown aircraft URI scheme' warning on empty selection X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=98a6b60b0055a7e6b245a21a44f6959b8c8fc22e;p=flightgear.git Launcher: silence 'Unknown aircraft URI scheme' warning on empty selection ------------------------------------------------------------------------ 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). --- diff --git a/src/GUI/AircraftModel.cxx b/src/GUI/AircraftModel.cxx index b4fe7f675..5783a1237 100644 --- a/src/GUI/AircraftModel.cxx +++ b/src/GUI/AircraftModel.cxx @@ -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(); }