MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / link

Method link

game/ui/general/transactioncontrol.cpp:155–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void TransactionControl::link(sp<TransactionControl> c1, sp<TransactionControl> c2)
156{
157 if (c1->linked && c2->linked)
158 {
159 LogError("Cannot link two already linked transaction controls!");
160 return;
161 }
162 if (!c2->linked)
163 {
164 if (!c1->linked)
165 {
166 c1->linked = mksp<std::list<wp<TransactionControl>>>();
167 c1->linked->emplace_back(c1);
168 }
169 c1->linked->emplace_back(c2);
170 c2->linked = c1->linked;
171 }
172 if (!c1->linked && c2->linked)
173 {
174 c2->linked->emplace_back(c1);
175 c1->linked = c2->linked;
176 }
177 // we assume c1 is older than c2, so we update c2 to match c1
178 c2->scrollBar->setValue(c1->scrollBar->getValue());
179 c2->updateValues();
180}
181
182const sp<std::list<wp<TransactionControl>>> &TransactionControl::getLinked() const
183{

Callers

nothing calls this directly

Calls 3

updateValuesMethod · 0.80
setValueMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected