From ed2762fd405c98e446508388672144acb9afe6f2 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 8 Aug 2019 15:18:03 +0200 Subject: [PATCH] Improved model file timestamp handling --- src/blackmisc/simulation/aircraftmodel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/blackmisc/simulation/aircraftmodel.cpp b/src/blackmisc/simulation/aircraftmodel.cpp index 10267b609..afff3a803 100644 --- a/src/blackmisc/simulation/aircraftmodel.cpp +++ b/src/blackmisc/simulation/aircraftmodel.cpp @@ -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()) {