mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Trigger validation with sim.directory
Ref T247 follow up
This commit is contained in:
committed by
Mat Sutcliffe
parent
36381351b9
commit
e8ea050882
@@ -304,7 +304,8 @@ namespace BlackCore
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_validator) { return false; }
|
||||
return m_validator->triggerValidation(simulator);
|
||||
const QString simDir = simulator.isSingleSimulator() ? m_simulatorSettings.getSimulatorDirectoryOrDefault(simulator) : "";
|
||||
return m_validator->triggerValidation(simulator, simDir);
|
||||
}
|
||||
|
||||
CAircraftModelList CContextSimulator::getModelSetModelsStartingWith(const QString &modelString) const
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace BlackMisc
|
||||
return m_simulator;
|
||||
}
|
||||
|
||||
bool CBackgroundValidation::triggerValidation(const CSimulatorInfo &simulator)
|
||||
bool CBackgroundValidation::triggerValidation(const CSimulatorInfo &simulator, const QString &simDirectory)
|
||||
{
|
||||
const QPointer<CBackgroundValidation> myself(this);
|
||||
if (simulator.isNoSimulator())
|
||||
@@ -71,7 +71,8 @@ namespace BlackMisc
|
||||
{
|
||||
QWriteLocker l(&m_lock);
|
||||
if (m_inWork) { return false; }
|
||||
m_simulator = simulator;
|
||||
m_simulator = simulator;
|
||||
m_simDirectory = simDirectory;
|
||||
m_checkedSimulatorMsgs.remove(simulator);
|
||||
}
|
||||
QTimer::singleShot(0, this, [ = ]
|
||||
@@ -136,8 +137,8 @@ namespace BlackMisc
|
||||
const qint64 now = QDateTime::currentMSecsSinceEpoch();
|
||||
const qint64 deltaTimeMs = now - started;
|
||||
msgs.push_back(CStatusMessage(this, CStatusMessage::SeverityInfo, QStringLiteral("Validated in %1ms").arg(deltaTimeMs)));
|
||||
msgs.sortBySeverityHighestFirst();
|
||||
msgs.freezeOrder();
|
||||
|
||||
validated = true;
|
||||
|
||||
QWriteLocker l(&m_lock);
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace BlackMisc
|
||||
|
||||
//! Trigger a validation, returns false if "work in progress"
|
||||
//! \threadsafe
|
||||
bool triggerValidation(const CSimulatorInfo &simulator);
|
||||
bool triggerValidation(const CSimulatorInfo &simulator, const QString &simDirectory);
|
||||
|
||||
//! Request last results (again), if there are any
|
||||
//! \remark emits CBackgroundValidation::validated signal
|
||||
|
||||
Reference in New Issue
Block a user