aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/bind.cpp2
-rw-r--r--node/countexecutenode.cpp2
-rw-r--r--node/executionnode.cpp3
-rw-r--r--node/explodedicenode.cpp6
-rw-r--r--node/groupnode.cpp2
-rw-r--r--node/helpnode.cpp2
-rw-r--r--node/jumpbackwardnode.cpp2
-rw-r--r--node/keepdiceexecnode.cpp2
-rw-r--r--node/listaliasnode.cpp10
-rw-r--r--node/listsetrollnode.cpp4
-rw-r--r--node/mergenode.cpp2
-rw-r--r--node/paintnode.cpp2
-rw-r--r--node/rerolldicenode.cpp4
-rw-r--r--node/scalaroperatornode.cpp8
-rw-r--r--node/sortresult.cpp3
-rw-r--r--node/splitnode.cpp4
-rw-r--r--node/stringnode.cpp2
17 files changed, 31 insertions, 29 deletions
diff --git a/node/bind.cpp b/node/bind.cpp
index a179069..9598c45 100644
--- a/node/bind.cpp
+++ b/node/bind.cpp
@@ -45,7 +45,7 @@ void BindNode::run(ExecutionNode* previous)
if(nullptr!=dice)
{
m_diceResult->setHomogeneous(false);
- for(Die* die : dice->getResultList())
+ for(auto& die : dice->getResultList())
{
if(!die->hasBeenDisplayed())
{
diff --git a/node/countexecutenode.cpp b/node/countexecutenode.cpp
index 205c6d7..d76c115 100644
--- a/node/countexecutenode.cpp
+++ b/node/countexecutenode.cpp
@@ -53,7 +53,7 @@ QString CountExecuteNode::toString(bool withlabel) const
{
if(withlabel)
{
- return QString("%1 [label=\"CountExecuteNode %2\"]").arg(m_id).arg(m_validator->toString());
+ return QString("%1 [label=\"CountExecuteNode %2\"]").arg(m_id,m_validator->toString());
}
else
{
diff --git a/node/executionnode.cpp b/node/executionnode.cpp
index d8e21a3..5b001fb 100644
--- a/node/executionnode.cpp
+++ b/node/executionnode.cpp
@@ -41,7 +41,8 @@ QMap<ExecutionNode::DICE_ERROR_CODE,QString> ExecutionNode::getExecutionErrorMap
{
if(nullptr!=m_nextNode)
{
- for(ExecutionNode::DICE_ERROR_CODE key: m_nextNode->getExecutionErrorMap().keys())
+ auto const& keys = m_nextNode->getExecutionErrorMap().keys();
+ for(auto& key: keys)
{
m_errors.insert(key,m_nextNode->getExecutionErrorMap().value(key));
}
diff --git a/node/explodedicenode.cpp b/node/explodedicenode.cpp
index b151de8..210f042 100644
--- a/node/explodedicenode.cpp
+++ b/node/explodedicenode.cpp
@@ -14,7 +14,7 @@ void ExplodeDiceNode::run(ExecutionNode* previous)
m_result->setPrevious(previous_result);
if(nullptr!=previous_result)
{
- for(Die* die: previous_result->getResultList())
+ for(auto& die: previous_result->getResultList())
{
Die* tmpdie = new Die();
*tmpdie=*die;
@@ -24,7 +24,7 @@ void ExplodeDiceNode::run(ExecutionNode* previous)
QList<Die*> list = m_diceResult->getResultList();
- for(Die* die: list)
+ for(auto& die: list)
{
while(m_validator->hasValid(die,false))
{
@@ -55,7 +55,7 @@ QString ExplodeDiceNode::toString(bool withlabel) const
{
if(withlabel)
{
- return QString("%1 [label=\"ExplodeDiceNode %2\"]").arg(m_id).arg(m_validator->toString());
+ return QString("%1 [label=\"ExplodeDiceNode %2\"]").arg(m_id, m_validator->toString());
}
else
{
diff --git a/node/groupnode.cpp b/node/groupnode.cpp
index c5b141d..a0bce3a 100644
--- a/node/groupnode.cpp
+++ b/node/groupnode.cpp
@@ -78,7 +78,7 @@ void GroupNode::run(ExecutionNode* previous)
{
auto list = dice->getResultList();
DieGroup allResult;
- for(Die* die : dice->getResultList())
+ for(auto& die : list)
{
allResult << die->getListValue();
}
diff --git a/node/helpnode.cpp b/node/helpnode.cpp
index 25efdcd..969c1cf 100644
--- a/node/helpnode.cpp
+++ b/node/helpnode.cpp
@@ -107,7 +107,7 @@ QString HelpNode::toString(bool wl) const
{
if(wl)
{
- return QString("%1 [label=\"Rolisteam Dice Parser:\nFull documentation at: %2\"]").arg(m_id).arg(m_path);
+ return QString("%1 [label=\"Rolisteam Dice Parser:\nFull documentation at: %2\"]").arg(m_id, m_path);
}
else
{
diff --git a/node/jumpbackwardnode.cpp b/node/jumpbackwardnode.cpp
index 2ca8874..2f04bb8 100644
--- a/node/jumpbackwardnode.cpp
+++ b/node/jumpbackwardnode.cpp
@@ -130,7 +130,7 @@ void JumpBackwardNode::run(ExecutionNode* previous)
DiceResult* diceResult = dynamic_cast<DiceResult*>(result);
if(nullptr!=diceResult)
{
- for(Die* die:diceResult->getResultList())
+ for(auto& die : diceResult->getResultList())
{
Die* tmpdie = new Die();
*tmpdie=*die;
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp
index dbd1591..40fd227 100644
--- a/node/keepdiceexecnode.cpp
+++ b/node/keepdiceexecnode.cpp
@@ -69,7 +69,7 @@ void KeepDiceExecNode::run(ExecutionNode* previous)
m_errors.insert(TOO_MANY_DICE,QObject::tr(" You ask to keep %1 dice but the result only has %2").arg(m_numberOfDice).arg(diceList.size()));
}
- for(Die* tmp : diceList.mid(static_cast<int>(m_numberOfDice),-1))
+ for(auto& tmp : diceList.mid(static_cast<int>(m_numberOfDice),-1))
{
tmp->setHighlighted(false);
}
diff --git a/node/listaliasnode.cpp b/node/listaliasnode.cpp
index a3d2d09..a15bfbc 100644
--- a/node/listaliasnode.cpp
+++ b/node/listaliasnode.cpp
@@ -46,25 +46,23 @@ void ListAliasNode::run(ExecutionNode* previous )
QString ListAliasNode::buildList() const
{
QString result(QObject::tr("List of Alias:\n"));
- for(DiceAlias* key: *m_aliasList)
+ for(auto& key: *m_aliasList)
{
- result+=QString("%1 : %2 # %3\n").arg(key->getCommand())
- .arg(key->getValue())
- .arg(key->getComment());
+ result+=QString("%1 : %2 # %3\n").arg(key->getCommand(),key->getValue(),key->getComment());
}
return result;
}
QString ListAliasNode::toString(bool wl) const
{
QStringList resultList;
- for(DiceAlias* key: *m_aliasList)
+ for(auto& key: *m_aliasList)
{
resultList << "{" <<key->getCommand() << key->getValue()<< "}";
}
if(wl)
{
- return QString("%1 [label=\"ListAliasNode %2\"]").arg(m_id).arg(resultList.join(","));
+ return QString("%1 [label=\"ListAliasNode %2\"]").arg(m_id, resultList.join(","));
}
else
{
diff --git a/node/listsetrollnode.cpp b/node/listsetrollnode.cpp
index eca6168..8771866 100644
--- a/node/listsetrollnode.cpp
+++ b/node/listsetrollnode.cpp
@@ -43,7 +43,7 @@ QString ListSetRollNode::toString(bool wl) const
{
if(wl)
{
- return QString("%1 [label=\"ListSetRoll list:%2\"]").arg(m_id).arg(m_values.join(","));
+ return QString("%1 [label=\"ListSetRoll list:%2\"]").arg(m_id,m_values.join(","));
}
else
{
@@ -113,7 +113,7 @@ void ListSetRollNode::computeFacesNumber(Die* die)
Q_ASSERT(m_values.size() == m_rangeList.size());
qint64 max;
int i=0;
- for(Range range: m_rangeList)
+ for(Range& range: m_rangeList)
{
if(((i==0)||(max<range.getEnd()))&&(range.isFullyDefined()))
{
diff --git a/node/mergenode.cpp b/node/mergenode.cpp
index f808854..c79521b 100644
--- a/node/mergenode.cpp
+++ b/node/mergenode.cpp
@@ -52,7 +52,7 @@ void MergeNode::run(ExecutionNode* previous)
{
///@todo TODO improve here to set homogeneous while is really
m_diceResult->setHomogeneous(false);
- for(Die* die : dice->getResultList())
+ for(auto& die : dice->getResultList())
{
if(!m_diceResult->getResultList().contains(die)&&(!die->hasBeenDisplayed()))
{
diff --git a/node/paintnode.cpp b/node/paintnode.cpp
index ddd19de..79aee60 100644
--- a/node/paintnode.cpp
+++ b/node/paintnode.cpp
@@ -78,7 +78,7 @@ void PainterNode::run(ExecutionNode* previous)
{
QList<Die*> diceList=previousDiceResult->getResultList();
int pastDice=0;
- for(ColorItem item:m_colors)
+ for(ColorItem& item : m_colors)
{
int current=item.colorNumber();
QList<Die*>::iterator it;
diff --git a/node/rerolldicenode.cpp b/node/rerolldicenode.cpp
index 3f0228c..471404e 100644
--- a/node/rerolldicenode.cpp
+++ b/node/rerolldicenode.cpp
@@ -26,7 +26,7 @@ void RerollDiceNode::run(ExecutionNode* previous)
m_result->setPrevious(previous_result);
if(nullptr!=previous_result)
{
- for(Die* die: previous_result->getResultList())
+ for(auto& die: previous_result->getResultList())
{
Die* tmpdie = new Die();
*tmpdie=*die;
@@ -96,7 +96,7 @@ QString RerollDiceNode::toString(bool wl) const
{
if(wl)
{
- return QString("%1 [label=\"RerollDiceNode validatior: %2\"]").arg(m_id).arg(m_validator->toString());
+ return QString("%1 [label=\"RerollDiceNode validatior: %2\"]").arg(m_id, m_validator->toString());
}
else
{
diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp
index 8172de7..d73f066 100644
--- a/node/scalaroperatornode.cpp
+++ b/node/scalaroperatornode.cpp
@@ -174,7 +174,7 @@ QString ScalarOperatorNode::toString(bool wl) const
}
if(wl)
{
- return QString("%1 [label=\"ScalarOperatorNode %2\"]").arg(m_id).arg(op);
+ return QString("%1 [label=\"ScalarOperatorNode %2\"]").arg(m_id, op);
}
else
{
@@ -241,14 +241,16 @@ QMap<ExecutionNode::DICE_ERROR_CODE,QString> ScalarOperatorNode::getExecutionErr
{
if(nullptr!=m_internalNode)
{
- for (ExecutionNode::DICE_ERROR_CODE key: m_internalNode->getExecutionErrorMap().keys())
+ auto keys = m_internalNode->getExecutionErrorMap().keys();
+ for (ExecutionNode::DICE_ERROR_CODE& key: keys)
{
m_errors.insert(key,m_internalNode->getExecutionErrorMap().value(key));
}
}
if(nullptr!=m_nextNode)
{
- for (ExecutionNode::DICE_ERROR_CODE key: m_nextNode->getExecutionErrorMap().keys())
+ auto keys = m_nextNode->getExecutionErrorMap().keys();
+ for (ExecutionNode::DICE_ERROR_CODE& key: keys)
{
m_errors.insert(key,m_nextNode->getExecutionErrorMap().value(key));
}
diff --git a/node/sortresult.cpp b/node/sortresult.cpp
index 76f517e..69611df 100644
--- a/node/sortresult.cpp
+++ b/node/sortresult.cpp
@@ -129,7 +129,8 @@ QString SortResultNode::toString(bool wl) const
{
if(wl)
{
- return QString("%1 [label=\"SortResultNode %2\"]").arg(m_id).arg(m_ascending ? "Ascending":"Descending");
+ auto order = m_ascending ? QStringLiteral("Ascending") : QStringLiteral("Descending");
+ return QString("%1 [label=\"SortResultNode %2\"]").arg(m_id, order);
}
else
{
diff --git a/node/splitnode.cpp b/node/splitnode.cpp
index d44bad5..4ef9c8c 100644
--- a/node/splitnode.cpp
+++ b/node/splitnode.cpp
@@ -39,11 +39,11 @@ void SplitNode::run(ExecutionNode* previous)
DiceResult* dice = dynamic_cast<DiceResult*>(tmpResult);
if(nullptr!=dice)
{
- for(Die* oldDie : dice->getResultList())
+ for(auto& oldDie : dice->getResultList())
{
oldDie->displayed();
m_diceResult->setOperator(oldDie->getOp());
- for(qint64 value : oldDie->getListValue())
+ for(qint64& value : oldDie->getListValue())
{
Die* tmpdie = new Die();
tmpdie->insertRollValue(value);
diff --git a/node/stringnode.cpp b/node/stringnode.cpp
index 5c489be..8f9796d 100644
--- a/node/stringnode.cpp
+++ b/node/stringnode.cpp
@@ -30,7 +30,7 @@ QString StringNode::toString(bool withLabel) const
{
QString dataCopy = m_data;
- return QString("%1 [label=\"StringNode %2\"]").arg(m_id).arg(dataCopy.replace('%','\\'));
+ return QString("%1 [label=\"StringNode %2\"]").arg(m_id, dataCopy.replace('%','\\'));
}
else
{