MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / registerPassthrough

Method registerPassthrough

launcher/settings/SettingsObject.cpp:44–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44std::shared_ptr<Setting> SettingsObject::registerPassthrough(std::shared_ptr<Setting> original, std::shared_ptr<Setting> gate)
45{
46 if (contains(original->id())) {
47 qCritical() << QString("Failed to register setting %1. ID already exists.").arg(original->id());
48 return nullptr; // Fail
49 }
50 auto passthrough = std::make_shared<PassthroughSetting>(original, gate);
51 passthrough->m_storage = this;
52 connectSignals(*passthrough);
53 m_settings.insert(passthrough->id(), passthrough);
54 return passthrough;
55}
56
57std::shared_ptr<Setting> SettingsObject::registerSetting(QStringList synonyms, QVariant defVal)
58{

Callers 2

BaseInstanceMethod · 0.80
loadSpecificSettingsMethod · 0.80

Calls 3

QStringClass · 0.85
insertMethod · 0.80
idMethod · 0.45

Tested by

no test coverage detected