MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / Down

Method Down

lib/macro/macro-tree.cpp:1355–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1353}
1354
1355void MacroTree::Down(std::shared_ptr<Macro> item) const
1356{
1357 auto lock = LockContext();
1358 auto below = GetModel()->Neighbor(item, false);
1359 if (!below) {
1360 return;
1361 }
1362
1363 if (item->IsSubitem()) {
1364 // Nowhere to move to, when the item below is a group or
1365 // regular entry
1366 if (!below->IsSubitem()) {
1367 return;
1368 }
1369
1370 MoveItemAfter(item, below);
1371 return;
1372 }
1373
1374 if (item->IsGroup()) {
1375 if (below->IsSubitem()) {
1376 below = GetModel()->FindEndOfGroup(below, false);
1377
1378 // Nowhere to move group to
1379 if (GetModel()->IsLastItem(below)) {
1380 return;
1381 }
1382
1383 below = GetModel()->Neighbor(below, false);
1384 }
1385 MoveItemAfter(item, below);
1386 return;
1387 }
1388
1389 MoveItemAfter(item, below);
1390}
1391
1392void MacroTree::GroupSelectedItems()
1393{

Callers

nothing calls this directly

Calls 6

LockContextFunction · 0.85
NeighborMethod · 0.80
IsSubitemMethod · 0.80
IsGroupMethod · 0.80
FindEndOfGroupMethod · 0.80
IsLastItemMethod · 0.80

Tested by

no test coverage detected