mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
No log message if already admitted
This commit is contained in:
committed by
Mat Sutcliffe
parent
0250e5a7ad
commit
f6e27bdf88
@@ -185,8 +185,10 @@ namespace BlackMisc
|
||||
}
|
||||
else
|
||||
{
|
||||
this->admitCacheImpl(sim);
|
||||
CLogMessage(this).info(u"Admit model (%1) caches for %2") << this->getDescription() << simStr;
|
||||
if (this->admitCacheImpl(sim))
|
||||
{
|
||||
CLogMessage(this).info(u"Admit model (%1) caches for %2") << this->getDescription() << simStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,11 +373,11 @@ namespace BlackMisc
|
||||
this->emitCacheChanged(simulator); // sync
|
||||
}
|
||||
|
||||
void CModelCaches::admitCacheImpl(const CSimulatorInfo &simulator)
|
||||
bool CModelCaches::admitCacheImpl(const CSimulatorInfo &simulator)
|
||||
{
|
||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||
|
||||
if (this->isCacheAlreadySynchronized(simulator)) { return; }
|
||||
if (this->isCacheAlreadySynchronized(simulator)) { return false; }
|
||||
switch (simulator.getSimulator())
|
||||
{
|
||||
case CSimulatorInfo::FS9: m_modelCacheFs9.admit(); break;
|
||||
@@ -387,6 +389,7 @@ namespace BlackMisc
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CModelSetCaches::CModelSetCaches(bool synchronizeCache, QObject *parent) : IMultiSimulatorModelCaches(parent)
|
||||
@@ -401,8 +404,10 @@ namespace BlackMisc
|
||||
}
|
||||
else
|
||||
{
|
||||
this->admitCacheImpl(simulator);
|
||||
CLogMessage(this).info(u"Admit model (%1) caches for %2") << this->getDescription() << simStr;
|
||||
if (this->admitCacheImpl(simulator))
|
||||
{
|
||||
CLogMessage(this).info(u"Admit model (%1) caches for %2") << this->getDescription() << simStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -556,11 +561,11 @@ namespace BlackMisc
|
||||
this->emitCacheChanged(simulator); // sync
|
||||
}
|
||||
|
||||
void CModelSetCaches::admitCacheImpl(const CSimulatorInfo &simulator)
|
||||
bool CModelSetCaches::admitCacheImpl(const CSimulatorInfo &simulator)
|
||||
{
|
||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||
|
||||
if (this->isCacheAlreadySynchronized(simulator)) { return; }
|
||||
if (this->isCacheAlreadySynchronized(simulator)) { return false; }
|
||||
switch (simulator.getSimulator())
|
||||
{
|
||||
case CSimulatorInfo::FS9: m_modelCacheFs9.admit(); break;
|
||||
@@ -572,6 +577,7 @@ namespace BlackMisc
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong simulator");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -345,7 +345,7 @@ namespace BlackMisc
|
||||
|
||||
//! Non virtual version (can be used in ctor)
|
||||
//! \threadsafe
|
||||
void admitCacheImpl(const CSimulatorInfo &simulator);
|
||||
bool admitCacheImpl(const CSimulatorInfo &simulator);
|
||||
};
|
||||
|
||||
//! Bundle of caches for model sets of all simulators
|
||||
@@ -386,7 +386,7 @@ namespace BlackMisc
|
||||
|
||||
//! Non virtual version (can be used in ctor)
|
||||
//! \threadsafe
|
||||
void admitCacheImpl(const CSimulatorInfo &simulator);
|
||||
bool admitCacheImpl(const CSimulatorInfo &simulator);
|
||||
};
|
||||
|
||||
//! One central instance of the caches base class
|
||||
|
||||
Reference in New Issue
Block a user