mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 05:55:33 +08:00
Caches: rename "get" to "getThreadLocal" and rename "getCopy" to get.
This commit is contained in:
committed by
Klaus Basan
parent
332d8e5fc8
commit
9bef6854ca
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -536,7 +536,7 @@ namespace BlackGui
|
||||
void CDockWidget::initSettings()
|
||||
{
|
||||
const QString name(this->getNameForSettings());
|
||||
CSettingsDockWidgets all = this->m_settings.getCopy();
|
||||
CSettingsDockWidgets all = this->m_settings.get();
|
||||
if (all.contains(name)) { return; }
|
||||
all.getByNameOrInitToDefault(name);
|
||||
this->m_settings.set(all);
|
||||
@@ -551,7 +551,7 @@ namespace BlackGui
|
||||
|
||||
CSettingsDockWidget CDockWidget::getSettings() const
|
||||
{
|
||||
const CSettingsDockWidgets all = this->m_settings.getCopy();
|
||||
const CSettingsDockWidgets all = this->m_settings.get();
|
||||
const QString name(this->getNameForSettings());
|
||||
const CSettingsDockWidget s = all.value(name);
|
||||
return s;
|
||||
@@ -561,7 +561,7 @@ namespace BlackGui
|
||||
{
|
||||
const CSettingsDockWidget current = getSettings();
|
||||
if (current == settings) { return; }
|
||||
CSettingsDockWidgets all = this->m_settings.getCopy();
|
||||
CSettingsDockWidgets all = this->m_settings.get();
|
||||
const QString name(this->getNameForSettings());
|
||||
all.insert(name, settings);
|
||||
const CStatusMessage m = this->m_settings.set(all); // saved when shutdown
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace BlackGui
|
||||
|
||||
const BlackMisc::Network::CAuthenticatedUser &CForm::getSwiftDbUser() const
|
||||
{
|
||||
return this->m_swiftDbUser.get();
|
||||
return this->m_swiftDbUser.getThreadLocal();
|
||||
}
|
||||
|
||||
void CForm::ps_userChanged()
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace BlackGui
|
||||
{
|
||||
Q_ASSERT_X(sGui && sGui->hasWebDataServices(), Q_FUNC_INFO, "Missing web data services");
|
||||
Q_ASSERT_X(this->m_simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator");
|
||||
const CDistributorListPreferences prefs(this->m_distributorPreferences.getCopy());
|
||||
const CDistributorListPreferences prefs(this->m_distributorPreferences.get());
|
||||
const CDistributorList distributors(prefs.getDistributors(this->m_simulator));
|
||||
if (!distributors.isEmpty()) { return distributors; }
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace BlackGui
|
||||
|
||||
bool COwnModelSetForm::hasDIstributorPreferences() const
|
||||
{
|
||||
const CDistributorListPreferences prefs(this->m_distributorPreferences.getCopy());
|
||||
const CDistributorListPreferences prefs(this->m_distributorPreferences.get());
|
||||
return !prefs.getDistributors(this->m_simulator).isEmpty();
|
||||
}
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user