MCPcopy Create free account
hub / github.com/benkuper/Chataigne / setDestModule

Method setDestModule

Source/Module/Routing/ModuleRouter.cpp:74–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void ModuleRouter::setDestModule(Module * m)
75{
76 if (m == destModule) return;
77
78 if (!destModuleRef.wasObjectDeleted() && destModule != nullptr)
79 {
80 destModule->removeInspectableListener(this);
81 destModuleRef = nullptr;
82 }
83
84 destModule = m;
85 if (destModule != nullptr)
86 {
87 destModuleRef = destModule;
88 destModule->addInspectableListener(this);
89 }
90
91 if (!sourceModuleRef.wasObjectDeleted())
92 {
93 for (auto &mrv : sourceValues.items)
94 {
95 mrv->setSourceAndOutModule(sourceModule, destModule);
96 mrv->forceDisabled = !enabled->boolValue();
97 }
98 }
99
100 if (routerController != nullptr) removeChildControllableContainer(routerController);
101 routerController = destModule != nullptr ? destModule->createModuleRouterController(this) : nullptr;
102 if (routerController != nullptr) addChildControllableContainer(routerController, true);
103
104 routerListeners.call(&RouterListener::destModuleChanged, this);
105}
106
107void ModuleRouter::reloadSourceValues(bool keepData)
108{

Callers 1

selectedModuleChangedMethod · 0.80

Calls 3

setSourceAndOutModuleMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected