Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: kis_node.cpp
- ===================================================================
- --- kis_node.cpp (revision 1189045)
- +++ kis_node.cpp (working copy)
- @@ -51,10 +51,13 @@
- {
- public:
- Private()
- - : graphListener(0)
- - , nodeProgressProxy(0) {
- + : nastyMutex(QMutex::Recursive)
- + , graphListener(0)
- + , nodeProgressProxy(0) {
- }
- + QMutex nastyMutex;
- +
- KisNodeWSP parent;
- KisNodeGraphListener * graphListener;
- QList<KisNodeSP> nodes;
- @@ -62,7 +65,7 @@
- };
- KisNode::KisNode()
- - : m_d(new Private())
- + : m_d(new Private())
- {
- m_d->parent = 0;
- m_d->graphListener = 0;
- @@ -70,8 +73,8 @@
- KisNode::KisNode(const KisNode & rhs)
- - : KisBaseNode(rhs)
- - , m_d(new Private())
- + : KisBaseNode(rhs),
- + m_d(new Private())
- {
- m_d->parent = 0;
- m_d->graphListener = rhs.m_d->graphListener;
- @@ -143,6 +146,8 @@
- KisNodeSP KisNode::firstChild() const
- {
- + QMutexLocker locker(&m_d->nastyMutex);
- +
- if (!m_d->nodes.isEmpty())
- return m_d->nodes.first();
- else
- @@ -151,6 +156,8 @@
- KisNodeSP KisNode::lastChild() const
- {
- + QMutexLocker locker(&m_d->nastyMutex);
- +
- if (!m_d->nodes.isEmpty())
- return m_d->nodes.last();
- else
- @@ -180,6 +187,8 @@
- KisNodeSP KisNode::at(quint32 index) const
- {
- + QMutexLocker locker(&m_d->nastyMutex);
- +
- if (!m_d->nodes.isEmpty() && index < (quint32)m_d->nodes.size()) {
- return m_d->nodes.at(index);
- }
- @@ -189,6 +198,8 @@
- int KisNode::index(const KisNodeSP node) const
- {
- + QMutexLocker locker(&m_d->nastyMutex);
- +
- if (m_d->nodes.contains(node)) {
- return m_d->nodes.indexOf(node);
- }
- @@ -198,6 +209,8 @@
- QList<KisNodeSP> KisNode::childNodes(const QStringList & nodeTypes, const KoProperties & properties) const
- {
- + QMutexLocker locker(&m_d->nastyMutex);
- +
- QList<KisNodeSP> nodes;
- foreach(const KisNodeSP & node, m_d->nodes) {
- @@ -216,6 +229,8 @@
- bool KisNode::add(KisNodeSP newNode, KisNodeSP aboveThis)
- {
- + QMutexLocker locker(&m_d->nastyMutex);
- +
- Q_ASSERT(newNode);
- if (!newNode) return false;
- @@ -257,6 +272,8 @@
- bool KisNode::remove(quint32 index)
- {
- + QMutexLocker locker(&m_d->nastyMutex);
- +
- if (index < childCount()) {
- KisNodeSP removedNode = at(index);
- removedNode->prepareForRemoval();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement