diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index e1eb0e9df..9b85ab283 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -705,21 +705,23 @@ namespace BlackCore // some checks for special conditions, e.g. logout -> empty list, but still signals pending if (this->isConnected() && remoteAircraft.hasValidCallsign()) { - const QString msg = QString("Ready for matching '%1' with model type '%2'").arg(callsign.toQString(), remoteAircraft.getModel().getModelTypeAsString()); - const CStatusMessage m = CMatchingUtils::logMessage(callsign, msg, getLogCategories()); + const QString readyMsg = QString("Ready for matching '%1' with model type '%2'").arg(callsign.toQString(), remoteAircraft.getModel().getModelTypeAsString()); + const CStatusMessage m = CMatchingUtils::logMessage(callsign, readyMsg, getLogCategories()); this->addReverseLookupMessage(callsign, m); emit this->readyForModelMatching(remoteAircraft); } else { - const CStatusMessage m = CMatchingUtils::logMessage(callsign, "Ignoring this aircraft, not found in range list", getLogCategories()); + const CStatusMessage m = CMatchingUtils::logMessage(callsign, "Ignoring this aircraft, not found in range list, disconnected, or no callsign", getLogCategories()); this->addReverseLookupMessage(callsign, m); } } void CAirspaceMonitor::onAtcPositionUpdate(const CCallsign &callsign, const BlackMisc::PhysicalQuantities::CFrequency &frequency, const CCoordinateGeodetic &position, const BlackMisc::PhysicalQuantities::CLength &range) { - Q_ASSERT(CThreadUtils::isCurrentThreadObjectThread(this)); + Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread"); + Q_ASSERT_X(sApp, Q_FUNC_INFO, "Need sApp"); + if (!this->isConnected()) { return; } const CAtcStationList stationsWithCallsign = m_atcStationsOnline.findByCallsign(callsign); if (stationsWithCallsign.isEmpty()) @@ -959,7 +961,7 @@ namespace BlackCore { const QString resolvedTelephony = CAircraftMatcher::reverseLookupTelephonyDesignator(telephony); airlineIcao.setTelephonyDesignator(resolvedTelephony); - CMatchingUtils::addLogDetailsToList(log, callsign, QString("Setting resolved telephoy designator '%1' from '%2'").arg(resolvedTelephony, telephony), getLogCategories()); + CMatchingUtils::addLogDetailsToList(log, callsign, QString("Setting resolved telephony designator '%1' from '%2'").arg(resolvedTelephony, telephony), getLogCategories()); } } diff --git a/src/blackcore/airspacemonitor.h b/src/blackcore/airspacemonitor.h index a524d87d7..cca6858c7 100644 --- a/src/blackcore/airspacemonitor.h +++ b/src/blackcore/airspacemonitor.h @@ -104,14 +104,19 @@ namespace BlackCore virtual bool updateAircraftRendered(const BlackMisc::Aviation::CCallsign &callsign, bool rendered) override; virtual bool updateAircraftGroundElevation(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Geo::CElevationPlane &elevation) override; virtual void updateMarkAllAsNotRendered() override; - virtual void enableReverseLookupMessages(bool enabled) override; - virtual bool isReverseLookupMessagesEnabled() const override; - virtual BlackMisc::CStatusMessageList getReverseLookupMessages(const BlackMisc::Aviation::CCallsign &callsign) const override; virtual BlackMisc::CStatusMessageList getAircraftPartsHistory(const BlackMisc::Aviation::CCallsign &callsign) const override; virtual bool isAircraftPartsHistoryEnabled() const override; virtual void enableAircraftPartsHistory(bool enabled) override; //! @} + //! \ingroup remoteaircraftprovider + //! \ingroup reverselookup + //! @{ + virtual void enableReverseLookupMessages(bool enabled) override; + virtual bool isReverseLookupMessagesEnabled() const override; + virtual BlackMisc::CStatusMessageList getReverseLookupMessages(const BlackMisc::Aviation::CCallsign &callsign) const override; + //! @} + //! Returns the list of users we know about BlackMisc::Network::CUserList getUsers() const; @@ -289,6 +294,9 @@ namespace BlackCore //! Connected with network? bool isConnected() const; + //! Get the currently connected server + const BlackMisc::Network::CServer getConnectedServer() const; + //! Supports VATSIM data file bool supportsVatsimDataFile() const; @@ -342,23 +350,23 @@ namespace BlackCore //! Send the information if aircraft and(!) client are available //! \note it can take some time to obtain all data for model matching, so function recursively calls itself if something is still missing (trial) + //! \sa reverseLookupModelWithFlightplanData void sendReadyForModelMatching(const BlackMisc::Aviation::CCallsign &callsign, int trial = 1); //! Reverse lookup messages //! \threadsafe + //! \ingroup reverselookup + //! @{ void addReverseLookupMessages(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::CStatusMessageList &messages); - - //! Reverse lookup messages - //! \threadsafe void addReverseLookupMessage(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::CStatusMessage &message); - - //! Reverse lookup messages - //! \threadsafe void addReverseLookupMessage( const BlackMisc::Aviation::CCallsign &callsign, const QString &message, BlackMisc::CStatusMessage::StatusSeverity severity = BlackMisc::CStatusMessage::SeverityInfo); + //! @} //! Reverse lookup, if available flight plan data are considered + //! \remark this is where a model is created based on network data + //! \ingroup reverselookup BlackMisc::Simulation::CAircraftModel reverseLookupModelWithFlightplanData( const BlackMisc::Aviation::CCallsign &callsign, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery, const QString &modelString, diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index 4fc2d397a..42457e185 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -415,6 +415,9 @@ namespace BlackCore BLACK_VERIFY_X(!callsign.isEmpty(), Q_FUNC_INFO, "Remote aircraft with empty callsign"); if (callsign.isEmpty()) { return; } + // here we find the best simulator model for a resolved model + // in the first step we already tried to find accurate ICAO codes etc. + // coming from CAirspaceMonitor::sendReadyForModelMatching CStatusMessageList matchingMessages; CStatusMessageList *pMatchingMessages = m_enableMatchingMessages ? &matchingMessages : nullptr; const CAircraftModel aircraftModel = m_aircraftMatcher.getClosestMatch(remoteAircraft, pMatchingMessages); @@ -423,8 +426,8 @@ namespace BlackCore const CSimulatedAircraft aircraftAfterModelApplied = getAircraftInRangeForCallsign(remoteAircraft.getCallsign()); m_simulatorPlugin.second->logicallyAddRemoteAircraft(aircraftAfterModelApplied); CMatchingUtils::addLogDetailsToList(pMatchingMessages, callsign, QString("Logically added remote aircraft: %1").arg(aircraftAfterModelApplied.toQString())); - addMatchingMessages(callsign, matchingMessages); - emit modelMatchingCompleted(remoteAircraft); + this->addMatchingMessages(callsign, matchingMessages); + emit this->modelMatchingCompleted(remoteAircraft); } void CContextSimulator::xCtxRemovedRemoteAircraft(const CCallsign &callsign) diff --git a/src/blackcore/db/icaodatareader.h b/src/blackcore/db/icaodatareader.h index 321aa17f7..1233e2020 100644 --- a/src/blackcore/db/icaodatareader.h +++ b/src/blackcore/db/icaodatareader.h @@ -15,9 +15,7 @@ #include "blackcore/blackcoreexport.h" #include "blackcore/db/databasereader.h" #include "blackcore/data/dbcaches.h" -#include "blackmisc/aviation/aircrafticaocode.h" #include "blackmisc/aviation/aircrafticaocodelist.h" -#include "blackmisc/aviation/airlineicaocode.h" #include "blackmisc/aviation/airlineicaocodelist.h" #include "blackmisc/network/entityflags.h" #include "blackmisc/network/url.h" diff --git a/src/blackcore/db/modeldatareader.cpp b/src/blackcore/db/modeldatareader.cpp index b3eed5ccf..0334b76d3 100644 --- a/src/blackcore/db/modeldatareader.cpp +++ b/src/blackcore/db/modeldatareader.cpp @@ -101,21 +101,21 @@ namespace BlackCore CAircraftModel CModelDataReader::getModelForModelString(const QString &modelString) const { if (modelString.isEmpty()) { return CAircraftModel(); } - const CAircraftModelList models(getModels()); + const CAircraftModelList models(this->getModels()); return models.findFirstByModelStringOrDefault(modelString); } CAircraftModel CModelDataReader::getModelForDbKey(int dbKey) const { if (dbKey < 0) { return CAircraftModel(); } - const CAircraftModelList models(getModels()); + const CAircraftModelList models(this->getModels()); return models.findByKey(dbKey); } CAircraftModelList CModelDataReader::getModelsForAircraftDesignatorAndLiveryCombinedCode(const QString &aircraftDesignator, const QString &combinedCode) { if (aircraftDesignator.isEmpty()) { return CAircraftModelList(); } - const CAircraftModelList models(getModels()); + const CAircraftModelList models(this->getModels()); return models.findByAircraftDesignatorAndLiveryCombinedCode(aircraftDesignator, combinedCode); } diff --git a/src/blackgui/components/modelmatchercomponent.cpp b/src/blackgui/components/modelmatchercomponent.cpp index c2f153651..7933f551e 100644 --- a/src/blackgui/components/modelmatchercomponent.cpp +++ b/src/blackgui/components/modelmatchercomponent.cpp @@ -83,7 +83,7 @@ namespace BlackGui void CModelMatcherComponent::tabIndexChanged(int index) { if (index < 0) { return; } - QTabWidget *tw = CGuiUtility::parentTabWidget(this); + const QTabWidget *tw = CGuiUtility::parentTabWidget(this); Q_ASSERT_X(tw, Q_FUNC_INFO, "Cannot find parent tab widget"); const QWidget *tabWidget = tw->currentWidget(); const QWidget *myselfTabWidget = this->parentWidget(); @@ -140,8 +140,7 @@ namespace BlackGui { if (number > 0 && entity.testFlag(CEntityFlags::ModelEntity) && state == CEntityFlags::ReadFinished) { - QStringList modelStrings(sGui->getWebDataServices()->getModelStrings()); - modelStrings.sort(); + const QStringList modelStrings(sGui->getWebDataServices()->getModelStrings(true)); ui->le_ModelString->setCompleter(new QCompleter(modelStrings, this)); } } diff --git a/src/blackgui/components/modelmatcherlogcomponent.ui b/src/blackgui/components/modelmatcherlogcomponent.ui index 2bfa25af9..fc2dec85c 100644 --- a/src/blackgui/components/modelmatcherlogcomponent.ui +++ b/src/blackgui/components/modelmatcherlogcomponent.ui @@ -66,6 +66,9 @@ + + Enables / disables future message logging + Enable: diff --git a/src/blackmisc/aviation/aircrafticaocode.cpp b/src/blackmisc/aviation/aircrafticaocode.cpp index e3ef15b43..1d5dec8be 100644 --- a/src/blackmisc/aviation/aircrafticaocode.cpp +++ b/src/blackmisc/aviation/aircrafticaocode.cpp @@ -72,14 +72,9 @@ namespace BlackMisc QString CAircraftIcaoCode::getDesignatorDbKey() const { - if (this->isLoadedFromDb()) - { - return this->getDesignator() + " " + this->getDbKeyAsStringInParentheses(); - } - else - { - return this->getDesignator(); - } + return (this->isLoadedFromDb()) ? + this->getDesignator() % QStringLiteral(" ") % this->getDbKeyAsStringInParentheses() : + this->getDesignator(); } QString CAircraftIcaoCode::convertToQString(bool i18n) const diff --git a/src/blackmisc/aviation/aircrafticaocode.h b/src/blackmisc/aviation/aircrafticaocode.h index 8732e9b63..ef75a0ae0 100644 --- a/src/blackmisc/aviation/aircrafticaocode.h +++ b/src/blackmisc/aviation/aircrafticaocode.h @@ -80,8 +80,11 @@ namespace BlackMisc //! Designator and DB key QString getDesignatorDbKey() const; + //! Designator + Manufacturer + QString getDesignatorManufacturer() const; + //! Set ICAO designator, e.g. "B737" - void setDesignator(const QString &icaoDesignator) { this->m_designator = icaoDesignator.trimmed().toUpper(); } + void setDesignator(const QString &icaoDesignator) { m_designator = icaoDesignator.trimmed().toUpper(); } //! Aircraft designator? bool hasDesignator() const; @@ -99,10 +102,10 @@ namespace BlackMisc const QString &getIataCode() const { return m_iataCode; } //! Set IATA code - void setIataCode(const QString &iata) { this->m_iataCode = iata.toUpper().trimmed(); } + void setIataCode(const QString &iata) { m_iataCode = iata.toUpper().trimmed(); } //! Has IATA code? - bool hasIataCode() const { return !this->m_iataCode.isEmpty(); } + bool hasIataCode() const { return !m_iataCode.isEmpty(); } //! IATA code same as designator? bool isIataSameAsDesignator() const; @@ -111,16 +114,16 @@ namespace BlackMisc const QString &getFamily() const { return m_family; } //! Set family - void setFamily(const QString &family) { this->m_family = family.toUpper().trimmed(); } + void setFamily(const QString &family) { m_family = family.toUpper().trimmed(); } //! Has family? - bool hasFamily() const { return !this->m_family.isEmpty(); } + bool hasFamily() const { return !m_family.isEmpty(); } //! Family same as designator? bool isFamilySameAsDesignator() const; //! Get type, e.g. "L2J" - const QString &getCombinedType() const { return this->m_combinedType; } + const QString &getCombinedType() const { return m_combinedType; } //! Combined type available? bool hasValidCombinedType() const; @@ -138,7 +141,7 @@ namespace BlackMisc QString getAircraftType() const; //! Set type - void setCombinedType(const QString &type) { this->m_combinedType = type.trimmed().toUpper(); } + void setCombinedType(const QString &type) { m_combinedType = type.trimmed().toUpper(); } //! Get IACO model description, e.g. "A-330-200" const QString &getModelDescription() const { return m_modelDescription; } @@ -159,9 +162,6 @@ namespace BlackMisc //! \remark * can be used as wildcard, e.g. L*J, L** bool matchesCombinedType(const QString &combinedType) const; - //! Designator + Manufacturer - QString getDesignatorManufacturer() const; - //! Set the model description (ICAO description) void setModelDescription(const QString &modelDescription) { m_modelDescription = modelDescription.trimmed(); } @@ -172,13 +172,13 @@ namespace BlackMisc void setModelSwiftDescription(const QString &modelDescription) { m_modelSwiftDescription = modelDescription.trimmed(); } //! Has model description? - bool hasModelDescription() const { return !this->m_modelDescription.isEmpty(); } + bool hasModelDescription() const { return !m_modelDescription.isEmpty(); } //! Has IATA model description? - bool hasModelIataDescription() const { return !this->m_modelIataDescription.isEmpty(); } + bool hasModelIataDescription() const { return !m_modelIataDescription.isEmpty(); } //! Has swift model description? - bool hasModelSwiftDescription() const { return !this->m_modelSwiftDescription.isEmpty(); } + bool hasModelSwiftDescription() const { return !m_modelSwiftDescription.isEmpty(); } //! Get manufacturer, e.g. "Airbus" const QString &getManufacturer() const { return m_manufacturer; } diff --git a/src/blackmisc/aviation/airlineicaocode.cpp b/src/blackmisc/aviation/airlineicaocode.cpp index 317dcddfc..d1be1be7e 100644 --- a/src/blackmisc/aviation/airlineicaocode.cpp +++ b/src/blackmisc/aviation/airlineicaocode.cpp @@ -411,23 +411,23 @@ namespace BlackMisc return CAirlineIcaoCode(); } - QString designator(json.value(prefix % QLatin1String("designator")).toString()); + QString designator(json.value(prefix % QStringLiteral("designator")).toString()); if (!CAirlineIcaoCode::isValidAirlineDesignator(designator)) { designator = CAirlineIcaoCode::normalizeDesignator(designator); } - const QString iata(json.value(prefix % QLatin1String("iata")).toString()); - const QString telephony(json.value(prefix % QLatin1String("callsign")).toString()); - const QString name(json.value(prefix % QLatin1String("name")).toString()); - const QString countryIso(json.value(prefix % QLatin1String("country")).toString()); - const QString countryName(json.value(prefix % QLatin1String("countryname")).toString()); - const QString groupName(json.value(prefix % QLatin1String("groupname")).toString()); - const QString groupDesignator(json.value(prefix % QLatin1String("groupdesignator")).toString()); - const int groupId(json.value(prefix % QLatin1String("groupid")).toInt(-1)); - const bool va = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QLatin1String("va")).toString()); - const bool operating = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QLatin1String("operating")).toString()); - const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QLatin1String("military")).toString()); + const QString iata(json.value(prefix % QStringLiteral("iata")).toString()); + const QString telephony(json.value(prefix % QStringLiteral("callsign")).toString()); + const QString name(json.value(prefix % QStringLiteral("name")).toString()); + const QString countryIso(json.value(prefix % QStringLiteral("country")).toString()); + const QString countryName(json.value(prefix % QStringLiteral("countryname")).toString()); + const QString groupName(json.value(prefix % QStringLiteral("groupname")).toString()); + const QString groupDesignator(json.value(prefix % QStringLiteral("groupdesignator")).toString()); + const int groupId(json.value(prefix % QStringLiteral("groupid")).toInt(-1)); + const bool va = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("va")).toString()); + const bool operating = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("operating")).toString()); + const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("military")).toString()); CAirlineIcaoCode code( designator, name, diff --git a/src/blackmisc/db/datastore.cpp b/src/blackmisc/db/datastore.cpp index 9bcefd5bf..66dafc59f 100644 --- a/src/blackmisc/db/datastore.cpp +++ b/src/blackmisc/db/datastore.cpp @@ -21,14 +21,14 @@ namespace BlackMisc { QString IDatastoreObjectWithIntegerKey::getDbKeyAsString() const { - if (this->m_dbKey < 0) { return ""; } - return QString::number(this->m_dbKey); + if (m_dbKey < 0) { return ""; } + return QString::number(m_dbKey); } QString IDatastoreObjectWithIntegerKey::getDbKeyAsStringInParentheses(const QString &prefix) const { - if (this->m_dbKey < 0) { return ""; } - return prefix + "(" + QString::number(this->m_dbKey) + ")"; + if (m_dbKey < 0) { return ""; } + return prefix + "(" + QString::number(m_dbKey) + ")"; } void IDatastoreObjectWithIntegerKey::setDbKey(const QString &key) @@ -36,7 +36,7 @@ namespace BlackMisc bool ok; int k = key.toInt(&ok); if (!ok) { k = -1; } - this->m_dbKey = k; + m_dbKey = k; } bool IDatastoreObjectWithIntegerKey::isLoadedFromDb() const @@ -68,7 +68,7 @@ namespace BlackMisc QJsonValue IDatastoreObjectWithIntegerKey::getDbKeyAsJsonValue() const { - if (this->hasValidDbKey()) { return QJsonValue(this->m_dbKey); } + if (this->hasValidDbKey()) { return QJsonValue(m_dbKey); } return QJsonValue(); } @@ -96,7 +96,7 @@ namespace BlackMisc const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexDbIntegerKey: return CVariant::from(this->m_dbKey); + case IndexDbIntegerKey: return CVariant::from(m_dbKey); case IndexDbKeyAsString: return CVariant::from(this->getDbKeyAsString()); case IndexIsLoadedFromDb: return CVariant::from(this->hasValidDbKey()); case IndexDatabaseIcon: return CVariant::from(this->toDatabaseIcon()); @@ -112,10 +112,10 @@ namespace BlackMisc switch (i) { case IndexDbIntegerKey: - this->m_dbKey = variant.toInt(); + m_dbKey = variant.toInt(); break; case IndexDbKeyAsString: - this->m_dbKey = stringToDbKey(variant.toQString()); + m_dbKey = stringToDbKey(variant.toQString()); default: break; } @@ -128,7 +128,7 @@ namespace BlackMisc switch (i) { case IndexDbKeyAsString: // fall thru - case IndexDbIntegerKey: return Compare::compare(this->m_dbKey, compareValue.getDbKey()); + case IndexDbIntegerKey: return Compare::compare(m_dbKey, compareValue.getDbKey()); case IndexDatabaseIcon: return Compare::compare(this->hasValidDbKey(), compareValue.hasValidDbKey()); default: break; } @@ -145,14 +145,14 @@ namespace BlackMisc QJsonValue IDatastoreObjectWithStringKey::getDbKeyAsJsonValue() const { - if (this->hasValidDbKey()) { return QJsonValue(this->m_dbKey); } + if (this->hasValidDbKey()) { return QJsonValue(m_dbKey); } static const QJsonValue null; return null; } QString IDatastoreObjectWithStringKey::getDbKeyAsStringInParentheses(const QString &prefix) const { - if (this->m_dbKey.isEmpty()) { return ""; } + if (m_dbKey.isEmpty()) { return ""; } return prefix + "(" + m_dbKey + ")"; } @@ -190,9 +190,9 @@ namespace BlackMisc switch (i) { case IndexDbKeyAsString: // fall thru - case IndexDbStringKey: return CVariant::from(this->m_dbKey); + case IndexDbStringKey: return CVariant::from(m_dbKey); case IndexDatabaseIcon: return CVariant::from(this->toDatabaseIcon()); - case IndexIsLoadedFromDb: return CVariant::from(this->m_loadedFromDb); + case IndexIsLoadedFromDb: return CVariant::from(m_loadedFromDb); default: break; } @@ -207,10 +207,10 @@ namespace BlackMisc { case IndexDbStringKey: case IndexDbKeyAsString: - this->m_dbKey = variant.value(); + m_dbKey = variant.value(); break; case IndexIsLoadedFromDb: - this->m_loadedFromDb = variant.toBool(); + m_loadedFromDb = variant.toBool(); break; default: break; @@ -224,7 +224,7 @@ namespace BlackMisc switch (i) { case IndexDbKeyAsString: // fall thru - case IndexDbStringKey: return this->m_dbKey.compare(compareValue.getDbKey()); + case IndexDbStringKey: return m_dbKey.compare(compareValue.getDbKey()); case IndexDatabaseIcon: return Compare::compare(this->hasValidDbKey(), compareValue.hasValidDbKey()); default: break; diff --git a/src/blackmisc/network/ecosystem.h b/src/blackmisc/network/ecosystem.h index 7fdb047e9..671ea1cef 100644 --- a/src/blackmisc/network/ecosystem.h +++ b/src/blackmisc/network/ecosystem.h @@ -35,7 +35,7 @@ namespace BlackMisc IndexSystemString }; - //! Known system + //! Known systems enum System { Unspecified, //!< unspecified diff --git a/src/blackmisc/simulation/aircraftmodellist.cpp b/src/blackmisc/simulation/aircraftmodellist.cpp index a8f04be4f..9d2e629f7 100644 --- a/src/blackmisc/simulation/aircraftmodellist.cpp +++ b/src/blackmisc/simulation/aircraftmodellist.cpp @@ -452,17 +452,17 @@ namespace BlackMisc int CAircraftModelList::keepModelsWithString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity) { - int cs = this->size(); + const int cs = this->size(); (*this) = (findByModelStrings(modelStrings, sensitivity)); - int d = cs - this->size(); + const int d = cs - this->size(); return d; } int CAircraftModelList::removeModelsWithString(const QStringList &modelStrings, Qt::CaseSensitivity sensitivity) { - int cs = this->size(); + const int cs = this->size(); (*this) = (this->findByNotInModelStrings(modelStrings, sensitivity)); - int d = cs - this->size(); + const int d = cs - this->size(); return d; }