From 88940eb6bc7d6895a951fafed71a1a8779841878 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 9 Dec 2017 09:46:14 +0000 Subject: [PATCH] Launcher: fix some warnings from QML --- src/GUI/AircraftDetailsView.qml | 21 +++++++++++++++++---- src/GUI/LocalAircraftCache.hxx | 3 ++- src/GUI/QmlAircraftInfo.cxx | 4 ++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/GUI/AircraftDetailsView.qml b/src/GUI/AircraftDetailsView.qml index 806023e92..5e3d21870 100644 --- a/src/GUI/AircraftDetailsView.qml +++ b/src/GUI/AircraftDetailsView.qml @@ -135,14 +135,21 @@ Rectangle { text: qsTr("Ratings:") } + AircraftRating { title: qsTr("Flight model") - value: aircraft.ratings[0] + Binding on value { + when: aircraft.ratings != undefined + value: aircraft.ratings[0] + } } AircraftRating { title: qsTr("Systems") - value: aircraft.ratings[1] + Binding on value { + when: aircraft.ratings != undefined + value: aircraft.ratings[1] + } } Item { @@ -152,12 +159,18 @@ Rectangle { AircraftRating { title: qsTr("Cockpit") - value: aircraft.ratings[2] + Binding on value { + when: aircraft.ratings != undefined + value: aircraft.ratings[2] + } } AircraftRating { title: qsTr("Exterior") - value: aircraft.ratings[3] + Binding on value { + when: aircraft.ratings != undefined + value: aircraft.ratings[3] + } } } diff --git a/src/GUI/LocalAircraftCache.hxx b/src/GUI/LocalAircraftCache.hxx index 0477dc8ed..761d1a530 100644 --- a/src/GUI/LocalAircraftCache.hxx +++ b/src/GUI/LocalAircraftCache.hxx @@ -120,7 +120,8 @@ public: PackageInstalled, PackageUpdateAvailable, PackageQueued, - PackageDownloading + PackageDownloading, + NotPackaged }; Q_ENUMS(PackageStatus) diff --git a/src/GUI/QmlAircraftInfo.cxx b/src/GUI/QmlAircraftInfo.cxx index 6a3ce4e70..fadab1d0d 100644 --- a/src/GUI/QmlAircraftInfo.cxx +++ b/src/GUI/QmlAircraftInfo.cxx @@ -271,7 +271,7 @@ QVariant QmlAircraftInfo::status() const return packageAircraftStatus(_package); } - return {}; + return LocalAircraftCache::AircraftOk; } QString QmlAircraftInfo::minimumFGVersion() const @@ -401,7 +401,7 @@ QVariant QmlAircraftInfo::installStatus() const } } - return {}; + return LocalAircraftCache::NotPackaged; } PackageRef QmlAircraftInfo::packageRef() const