Fix wrong launcher aircraft name on startup
The mapping from aircraft URI to name was wrong for local (non-package) aircraft, as spotted by Thorsten Renk. Note other data (thumbnail) is still incorrect, but another change I have pending will replace this code anyway so only doing the simple fix for now.
This commit is contained in:
parent
2bf5a96aec
commit
b870b3f022
1 changed files with 6 additions and 1 deletions
|
@ -678,7 +678,12 @@ void LauncherMainWindow::updateSelectedAircraft()
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
QPixmap pm = index.data(Qt::DecorationRole).value<QPixmap>();
|
QPixmap pm = index.data(Qt::DecorationRole).value<QPixmap>();
|
||||||
m_ui->thumbnail->setPixmap(pm);
|
m_ui->thumbnail->setPixmap(pm);
|
||||||
m_ui->aircraftName->setText(index.data(Qt::DisplayRole).toString());
|
|
||||||
|
// important to use this version to get the variant-specific name
|
||||||
|
// correct; the QModelIndex lookup doesn't do that.
|
||||||
|
// actually all the data is for the primary variant, but this will be
|
||||||
|
// fixed when enabling the LocalAircraftCache outside the AircaftModel
|
||||||
|
m_ui->aircraftName->setText(m_aircraftModel->nameForAircraftURI(m_selectedAircraft));
|
||||||
|
|
||||||
QVariant longDesc = index.data(AircraftLongDescriptionRole);
|
QVariant longDesc = index.data(AircraftLongDescriptionRole);
|
||||||
m_ui->aircraftDescription->setVisible(!longDesc.isNull());
|
m_ui->aircraftDescription->setVisible(!longDesc.isNull());
|
||||||
|
|
Loading…
Reference in a new issue