mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
Some more fixes:
* sort order in compare was inverted * correct message when model is empty
This commit is contained in:
@@ -476,17 +476,19 @@ namespace BlackGui
|
|||||||
Q_ASSERT(getIContextOwnAircraft());
|
Q_ASSERT(getIContextOwnAircraft());
|
||||||
Q_ASSERT(getIContextSimulator());
|
Q_ASSERT(getIContextSimulator());
|
||||||
|
|
||||||
|
if (!this->getIContextSimulator()->isSimulatorAvailable()) { return; }
|
||||||
CAircraftModel model(this->getIContextOwnAircraft()->getOwnAircraft().getModel());
|
CAircraftModel model(this->getIContextOwnAircraft()->getOwnAircraft().getModel());
|
||||||
|
QString modelStr(model.hasModelString() ? model.getModelString() : "<unknown>");
|
||||||
if (model.getAircraftIcaoCode().hasDesignator())
|
if (model.getAircraftIcaoCode().hasDesignator())
|
||||||
{
|
{
|
||||||
CLogMessage(this).validationInfo("Reverse lookup for %1") << model.getModelString();
|
CLogMessage(this).validationInfo("Reverse lookup for %1") << modelStr;
|
||||||
|
|
||||||
// update GUI
|
// update GUI
|
||||||
this->setGuiIcaoValues(model, false);
|
this->setGuiIcaoValues(model, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogMessage(this).validationInfo("Reverse lookup for %1 failed, set data manually") << model.getModelString();
|
CLogMessage(this).validationInfo("Reverse lookup for %1 failed, set data manually") << modelStr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
int c = a.comparePropertyByIndex(b, index);
|
int c = a.comparePropertyByIndex(b, index);
|
||||||
if (c == 0) { return false; }
|
if (c == 0) { return false; }
|
||||||
return (order == Qt::AscendingOrder) ? (c > 0) : (c < 0);
|
return (order == Qt::AscendingOrder) ? (c < 0) : (c > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sort without compare function
|
//! Sort without compare function
|
||||||
|
|||||||
Reference in New Issue
Block a user