Caches: rename "get" to "getThreadLocal" and rename "getCopy" to get.

This commit is contained in:
Mathew Sutcliffe
2016-06-06 15:47:11 +01:00
committed by Klaus Basan
parent 332d8e5fc8
commit 9bef6854ca
30 changed files with 83 additions and 83 deletions

View File

@@ -75,7 +75,7 @@ namespace BlackGui
void CAudioSetupComponent::ps_reloadSettings()
{
CSettingsAudio as(m_audioSettings.get());
CSettingsAudio as(m_audioSettings.getThreadLocal());
this->ui->cb_SetupAudioPlayNotificationSounds->setChecked(true);
this->ui->cb_SetupAudioNotificationTextMessage->setChecked(as.getNotificationFlag(CNotificationSounds::NotificationTextMessagePrivate));
this->ui->cb_SetupAudioNotificationVoiceRoom->setChecked(as.getNotificationFlag(CNotificationSounds::NotificationVoiceRoomJoined));

View File

@@ -43,7 +43,7 @@ namespace BlackGui
void CDbDebugDatabaseSetup::ps_debugChanged(bool set)
{
CGlobalSetup gs(m_setup.get());
CGlobalSetup gs(m_setup.getThreadLocal());
gs.setServerDebugFlag(set);
m_setup.set(gs);
}

View File

@@ -48,7 +48,7 @@ namespace BlackGui
// should be single simulator or no simulator (default)
this->m_simulatorSelection.synchronize();
const CSimulatorInfo simulator(this->m_simulatorSelection.getCopy());
const CSimulatorInfo simulator(this->m_simulatorSelection.get());
const bool s = this->initModelLoader(!simulator.isSingleSimulator() ? CSimulatorInfo(CSimulatorInfo::FSX) : simulator);
if (s)
{

View File

@@ -278,7 +278,7 @@ namespace BlackGui
void CDbOwnModelSetComponent::ps_distributorPreferencesChanged()
{
const CDistributorListPreferences preferences = this->m_distributorPreferences.get();
const CDistributorListPreferences preferences = this->m_distributorPreferences.getThreadLocal();
const CSimulatorInfo simuulator = preferences.getLastUpdatedSimulator();
if (simuulator.isSingleSimulator())
{
@@ -316,7 +316,7 @@ namespace BlackGui
{
CAircraftModelList modelSet = this->m_modelSetLoader.getAircraftModels(simulator);
if (modelSet.isEmpty()) { return; }
const CDistributorListPreferences preferences = this->m_distributorPreferences.get();
const CDistributorListPreferences preferences = this->m_distributorPreferences.getThreadLocal();
const CDistributorList distributors = preferences.getDistributors(simulator);
if (distributors.isEmpty()) { return; }
modelSet.updateDistributorOrder(distributors);

View File

@@ -74,7 +74,7 @@ namespace BlackGui
{
// changed somewhere else
const CSimulatorInfo sim(ui->comp_SimulatorSelector->getValue());
const CDistributorList distributors = this->m_distributorPreferences.get().getDistributors(sim);
const CDistributorList distributors = this->m_distributorPreferences.getThreadLocal().getDistributors(sim);
this->updateContainerMaybeAsync(distributors);
}
@@ -128,7 +128,7 @@ namespace BlackGui
{
const CDistributorList distributors(ui->tvp_Distributors->container());
const CSimulatorInfo simulator = ui->comp_SimulatorSelector->getValue();
CDistributorListPreferences preferences = this->m_distributorPreferences.get();
CDistributorListPreferences preferences = this->m_distributorPreferences.getThreadLocal();
preferences.setDistributors(distributors, simulator);
const CStatusMessage m = this->m_distributorPreferences.setAndSave(preferences);
CLogMessage::preformatted(m);
@@ -137,7 +137,7 @@ namespace BlackGui
void CDistributorPreferencesComponent::ps_simulatorChanged(const CSimulatorInfo &simulator)
{
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Expect single simulator");
const CDistributorList distributors(this->m_distributorPreferences.get().getDistributors(simulator));
const CDistributorList distributors(this->m_distributorPreferences.getThreadLocal().getDistributors(simulator));
ui->tvp_Distributors->updateContainerMaybeAsync(distributors);
}

View File

@@ -129,7 +129,7 @@ namespace BlackGui
ps_validateAircraftValues();
ps_validateVatsimValues();
ps_onWebServiceDataRead(CEntityFlags::VatsimDataFile, CEntityFlags::ReadFinished, -1);
CServerList otherServers(this->m_otherTrafficNetworkServers.get());
CServerList otherServers(this->m_otherTrafficNetworkServers.getThreadLocal());
// add a testserver when no servers can be loaded
if (otherServers.isEmpty() && (sGui->isRunningInDeveloperEnvironment() || CBuildConfig::isBetaTest()))
@@ -470,7 +470,7 @@ namespace BlackGui
void CLoginComponent::ps_reloadSettings()
{
CServerList otherServers(this->m_otherTrafficNetworkServers.get());
CServerList otherServers(this->m_otherTrafficNetworkServers.getThreadLocal());
this->ui->cbp_OtherServers->setServers(otherServers);
}

View File

@@ -106,28 +106,28 @@ namespace BlackGui
void CSettingsHotkeyComponent::addHotkeytoSettings(const CActionHotkey &actionHotkey)
{
CActionHotkeyList actionHotkeyList(m_actionHotkeys.get());
CActionHotkeyList actionHotkeyList(m_actionHotkeys.getThreadLocal());
actionHotkeyList.push_back(actionHotkey);
m_actionHotkeys.set(actionHotkeyList);
}
void CSettingsHotkeyComponent::updateHotkeyInSettings(const CActionHotkey &oldValue, const CActionHotkey &newValue)
{
CActionHotkeyList actionHotkeyList(m_actionHotkeys.get());
CActionHotkeyList actionHotkeyList(m_actionHotkeys.getThreadLocal());
actionHotkeyList.replace(oldValue, newValue);
m_actionHotkeys.set(actionHotkeyList);
}
void CSettingsHotkeyComponent::removeHotkeyFromSettings(const CActionHotkey &actionHotkey)
{
CActionHotkeyList actionHotkeyList(m_actionHotkeys.get());
CActionHotkeyList actionHotkeyList(m_actionHotkeys.getThreadLocal());
actionHotkeyList.remove(actionHotkey);
m_actionHotkeys.set(actionHotkeyList);
}
bool CSettingsHotkeyComponent::checkAndConfirmConflicts(const CActionHotkey &actionHotkey, const CActionHotkeyList &ignore)
{
auto configuredHotkeys = m_actionHotkeys.get();
auto configuredHotkeys = m_actionHotkeys.getThreadLocal();
CActionHotkeyList conflicts = configuredHotkeys.findSupersetsOf(actionHotkey);
conflicts.push_back(configuredHotkeys.findSubsetsOf(actionHotkey));
conflicts.removeIfIn(ignore);

View File

@@ -58,7 +58,7 @@ namespace BlackGui
void CSettingsNetworkServersComponent::ps_reloadSettings()
{
CServerList serverList(m_trafficNetworkServers.getCopy());
CServerList serverList(m_trafficNetworkServers.get());
// add swift test servers in case we have no servers:
// this is debug/bootstrap feature we can continue to test when something goes wrong
@@ -81,7 +81,7 @@ namespace BlackGui
CStatusMessageList msgs = server.validate();
if (!msgs.isEmpty()) { msgs.addCategories(this); }
CServerList serverList(m_trafficNetworkServers.get());
CServerList serverList(m_trafficNetworkServers.getThreadLocal());
QObject *sender = QObject::sender();
CStatusMessage msg;
bool changed = false;

View File

@@ -150,7 +150,7 @@ namespace BlackGui
return;
}
auto e = m_enabledSimulators.get();
auto e = m_enabledSimulators.getThreadLocal();
if (enabled && !e.contains(selected->getIdentifier()))
{
e << selected->getIdentifier();
@@ -301,7 +301,7 @@ namespace BlackGui
void CSettingsSimulatorComponent::ps_reloadPluginConfig()
{
// list all available simulators
auto enabledSimulators = m_enabledSimulators.get();
auto enabledSimulators = m_enabledSimulators.getThreadLocal();
for (const auto &p : getAvailablePlugins())
{
ui->ps_EnabledSimulators->setEnabled(p.getIdentifier(), enabledSimulators.contains(p.getIdentifier()));