mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Ref T268, interpolation setup provider (no QObject) can "emit signal" by using a virtual function
This commit is contained in:
@@ -84,12 +84,11 @@ namespace BlackMisc
|
||||
bool IInterpolationSetupProvider::setInterpolationSetupGlobal(const CInterpolationAndRenderingSetupGlobal &setup)
|
||||
{
|
||||
{
|
||||
QReadLocker l(&m_lockSetup);
|
||||
QWriteLocker l(&m_lockSetup);
|
||||
if (m_globalSetup == setup) { return false; }
|
||||
m_globalSetup = setup;
|
||||
}
|
||||
|
||||
QWriteLocker l(&m_lockSetup);
|
||||
m_globalSetup = setup;
|
||||
this->emitInterpolationSetupChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -105,11 +104,25 @@ namespace BlackMisc
|
||||
return false;
|
||||
}
|
||||
}
|
||||
QWriteLocker l(&m_lockSetup);
|
||||
m_setups[callsign] = setup;
|
||||
{
|
||||
QWriteLocker l(&m_lockSetup);
|
||||
m_setups[callsign] = setup;
|
||||
}
|
||||
this->emitInterpolationSetupChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IInterpolationSetupProvider::removeInterpolationSetupPerCallsign(const CCallsign &callsign)
|
||||
{
|
||||
bool removed = false;
|
||||
{
|
||||
QWriteLocker l(&m_lockSetup);
|
||||
removed = m_setups.remove(callsign) > 0;
|
||||
}
|
||||
if (removed) { this->emitInterpolationSetupChanged(); }
|
||||
return removed;
|
||||
}
|
||||
|
||||
void IInterpolationSetupProvider::setLogCallsign(bool log, const CCallsign &callsign)
|
||||
{
|
||||
CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign);
|
||||
@@ -134,9 +147,24 @@ namespace BlackMisc
|
||||
if (setup.isEqualToGlobal(global)) { continue; }
|
||||
setupsToKeep.insert(cs, setup);
|
||||
}
|
||||
{
|
||||
QWriteLocker l(&m_lockSetup);
|
||||
m_setups = setupsToKeep;
|
||||
}
|
||||
this->emitInterpolationSetupChanged();
|
||||
}
|
||||
|
||||
QWriteLocker l(&m_lockSetup);
|
||||
m_setups = setupsToKeep;
|
||||
int IInterpolationSetupProvider::clearInterpolationSetupsPerCallsign()
|
||||
{
|
||||
int r = 0;
|
||||
{
|
||||
QWriteLocker l(&m_lockSetup);
|
||||
r = m_setups.size();
|
||||
m_setups.clear();
|
||||
}
|
||||
|
||||
if (r > 0) { this->emitInterpolationSetupChanged(); }
|
||||
return r;
|
||||
}
|
||||
|
||||
bool IInterpolationSetupProvider::logAnyCallsign() const
|
||||
|
||||
Reference in New Issue
Block a user