Ref T335, misc. improvements of value classes/list

- verifyModelData
- setModelType
- getCallsignsAsString
This commit is contained in:
Klaus Basan
2018-09-12 16:18:56 +02:00
parent 7d715a909e
commit c675ef5c32
8 changed files with 61 additions and 4 deletions

View File

@@ -136,6 +136,26 @@ namespace BlackMisc
.arg(this->getLivery().asHtmlSummary(" ")).replace(" ", " ");
}
CStatusMessageList CAircraftModel::verifyModelData() const
{
CStatusMessageList msgs;
const ModelType t = this->getModelType();
if (t == TypeOwnSimulatorModel || t == TypeManuallySet || t == TypeDatabaseEntry)
{
if (!this->existsCorrespondingFile())
{
const CStatusMessage m = CStatusMessage(this).validationError("File '%1' not readable") << this->getFileName();
msgs.push_back(m);
}
}
else
{
const CStatusMessage m = CStatusMessage(this).validationError("Invalid model type to check: '%1'") << this->getModelTypeAsString();
msgs.push_back(m);
}
return msgs;
}
bool CAircraftModel::canInitializeFromFsd() const
{
const bool nw = this->getModelType() == CAircraftModel::TypeQueriedFromNetwork ||
@@ -721,7 +741,7 @@ namespace BlackMisc
static const QString db("database");
static const QString def("map.default");
static const QString ownSim("own simulator");
static const QString set("set");
static const QString set("manually set");
static const QString fsinn("FSInn");
static const QString probe("probe");
static const QString unknown("unknown");