From f053853e87624a045438bacd4dd1494e91ae381f Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 27 Oct 2017 22:19:20 +0200 Subject: -c++11 update about for and nullptr. --- node/paintnode.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'node/paintnode.cpp') diff --git a/node/paintnode.cpp b/node/paintnode.cpp index 5a85590..035334e 100644 --- a/node/paintnode.cpp +++ b/node/paintnode.cpp @@ -53,32 +53,32 @@ void ColorItem::setColor(const QString &color) PainterNode::PainterNode() : ExecutionNode() { - m_result = NULL; - m_nextNode = NULL; + m_result = nullptr; + m_nextNode = nullptr; } PainterNode::~PainterNode() { - m_result = NULL; + m_result = nullptr; } void PainterNode::run(ExecutionNode* previous) { m_previousNode = previous; - if(NULL==previous) + if(nullptr==previous) { return; } Result* previousResult = previous->getResult(); //m_result = previousResult; DiceResult* previousDiceResult = dynamic_cast(previousResult); - if(NULL!=previousDiceResult) + if(nullptr!=previousDiceResult) { QList diceList=previousDiceResult->getResultList(); int pastDice=0; - foreach(ColorItem item, m_colors) + for(ColorItem item: m_colors) { int current=item.colorNumber(); QList::iterator it; @@ -90,7 +90,7 @@ void PainterNode::run(ExecutionNode* previous) } } } - if(NULL!=m_nextNode) + if(nullptr!=m_nextNode) { m_nextNode->run(previous); } @@ -127,7 +127,7 @@ void PainterNode::insertColorItem(QString color, int value) ExecutionNode* PainterNode::getCopy() const { PainterNode* node = new PainterNode(); - if(NULL!=m_nextNode) + if(nullptr!=m_nextNode) { node->setNextNode(m_nextNode->getCopy()); } -- cgit v1.2.3-70-g09d2