Improved model file timestamp handling

This commit is contained in:
Klaus Basan
2019-08-08 15:18:03 +02:00
committed by Mat Sutcliffe
parent b213f594c7
commit ed2762fd40

View File

@@ -638,15 +638,19 @@ namespace BlackMisc
return;
}
// local file names and file timestamp
this->updateLocalFileNames(otherModel);
if (this->hasValidDbKey() && otherModel.hasValidDbKey()) { return; } // both are DB data, treat as being the same except for filename maybe
if (m_fileTimestamp < 0 || otherModel.m_fileTimestamp > m_fileTimestamp) { this->setFileTimestamp(otherModel.getFileTimestamp()); }
// both are DB data, treat as being the same except for filename maybe
if (this->hasValidDbKey() && otherModel.hasValidDbKey()) { return; }
// update attributes where applicable
if (m_callsign.isEmpty()) { this->setCallsign(otherModel.getCallsign()); }
if (m_modelString.isEmpty()) { this->setModelString(otherModel.getModelString()); }
if (m_name.isEmpty()) { this->setName(otherModel.getName()); }
if (m_modelType == TypeUnknown) { m_modelType = otherModel.getModelType(); }
if (m_modelMode == Undefined) { m_modelType = otherModel.getModelType(); }
if (m_fileTimestamp < 0) { this->setFileTimestamp(otherModel.getFileTimestamp()); }
if (m_description.isEmpty() || m_description.startsWith(CAircraftModel::autoGenerated(), Qt::CaseInsensitive)) { this->setDescription(otherModel.getDescription()); }
if (this->getSimulator().isUnspecified())
{