MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / registerPassthrough

Method registerPassthrough

launcher/settings/SettingsObject.cpp:49–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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