21 #include "blockcontext.h"
25 void BlockContext::addBlocks(
const QHash<QString, BlockNode *> &blocks)
27 auto it = blocks.constBegin();
28 const auto end = blocks.constEnd();
30 for (; it != end; ++it) {
31 m_blocks[it.key()].prepend(it.value());
37 auto list = m_blocks[name];
46 QList<BlockNode *> &list = m_blocks[name];
49 return list.takeLast();
54 m_blocks[name].append(
const_cast<BlockNode *
>(blockNode));
57 bool BlockContext::isEmpty() {
return m_blocks.isEmpty(); }
59 void BlockContext::remove(QList<BlockNode *>
const &nodes)
61 for (
auto node : nodes) {
62 m_blocks[node->name()].removeOne(node);
63 if (m_blocks[node->name()].isEmpty()) {
64 m_blocks.remove(node->name());