From 2d3a37b290b9fbd9be7a7fc4e722b30bb160ffd5 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 27 Aug 2015 01:29:45 +0200 Subject: disable the highlight --- node/helpnode.cpp | 1 + node/listaliasnode.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'node') diff --git a/node/helpnode.cpp b/node/helpnode.cpp index 6108e4d..62dc86e 100644 --- a/node/helpnode.cpp +++ b/node/helpnode.cpp @@ -9,6 +9,7 @@ void HelpNode::run(ExecutionNode* previous) { m_previousNode = previous; StringResult* txtResult = dynamic_cast(m_result); + txtResult->setHighLight(false); if(NULL != previous) { diff --git a/node/listaliasnode.cpp b/node/listaliasnode.cpp index ddb8ac9..1809eac 100644 --- a/node/listaliasnode.cpp +++ b/node/listaliasnode.cpp @@ -29,6 +29,7 @@ void ListAliasNode::run(ExecutionNode* previous ) { m_previousNode = previous; StringResult* txtResult = dynamic_cast(m_result); + txtResult->setHighLight(false); if(NULL != previous) { -- cgit v1.2.3-70-g09d2 From da1db7bc2436f94ab288d8da8d98a8209d3d2caa Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 28 Aug 2015 08:35:33 +0200 Subject: fix cppcheck issue --- booleancondition.cpp | 1 + diceparser.cpp | 17 +++++++++-------- node/keepdiceexecnode.cpp | 4 +--- node/parenthesesnode.cpp | 1 + node/scalaroperatornode.cpp | 2 +- node/sortresult.cpp | 7 +------ parsingtoolbox.cpp | 5 +++-- result/result.cpp | 2 +- 8 files changed, 18 insertions(+), 21 deletions(-) (limited to 'node') diff --git a/booleancondition.cpp b/booleancondition.cpp index 533ec02..c5fd7c7 100644 --- a/booleancondition.cpp +++ b/booleancondition.cpp @@ -23,6 +23,7 @@ BooleanCondition::BooleanCondition() + : m_operator(Equal) { } qint64 BooleanCondition::hasValid(Die* b,bool recursive,bool unhighlight) const diff --git a/diceparser.cpp b/diceparser.cpp index 8c910a2..bfe8247 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -42,7 +42,7 @@ #define DEFAULT_FACES_NUMBER 10 DiceParser::DiceParser() - : m_start(NULL) + : m_start(NULL),m_current(NULL) { m_parsingToolbox = new ParsingToolBox(); @@ -166,7 +166,8 @@ bool DiceParser::parseLine(QString str) keepParsing =!str.isEmpty(); if(keepParsing) { - keepParsing = readOperator(str,m_current); + // keepParsing = + readOperator(str,m_current); m_current = getLatestNode(m_current); } @@ -428,7 +429,6 @@ void DiceParser::getLastDiceResult(ExportedDiceResult& diceValues) DiceResult* diceResult = dynamic_cast(result); if(NULL!=diceResult) { - bool hasResult = false; quint64 face=0; ListDiceResult listpair; foreach(Die* die, diceResult->getResultList()) @@ -436,7 +436,6 @@ void DiceParser::getLastDiceResult(ExportedDiceResult& diceValues) if(!die->hasBeenDisplayed()) { QList valuesResult; - hasResult=true; valuesResult.append(die->getValue()); die->displayed(); face = die->getFaces(); @@ -545,10 +544,10 @@ bool DiceParser::readDice(QString& str,ExecutionNode* & node) if(readDiceOperator(str,currentOperator)) { - int num; - int end; if(currentOperator==D) { + int num; + int end; if(m_parsingToolbox->readNumber(str,num)) { if(num<1) @@ -837,7 +836,8 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous, bool hasDice)/ if(NULL!=validator) { /// @todo display warning here. - bool b = m_parsingToolbox->isValidValidator(previous,validator); + //bool b = + m_parsingToolbox->isValidValidator(previous,validator); CountExecuteNode* countNode = new CountExecuteNode(); countNode->setValidator(validator); @@ -859,7 +859,8 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous, bool hasDice)/ if(NULL!=validator) { /// @todo display warning here. - bool b = m_parsingToolbox->isValidValidator(previous,validator); + //bool b = + m_parsingToolbox->isValidValidator(previous,validator); RerollDiceNode* rerollNode = new RerollDiceNode(); if(m_OptionOp->value(tmp)==RerollAndAdd) { diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp index a225ac4..a230107 100644 --- a/node/keepdiceexecnode.cpp +++ b/node/keepdiceexecnode.cpp @@ -42,10 +42,8 @@ m_previousNode = previous; if(NULL!=previousDiceResult) { QList diceList=previousDiceResult->getResultList(); - QList diceList2=m_diceResult->getResultList(); + QList diceList2 = diceList.mid(0,m_numberOfDice); - - diceList2 = diceList.mid(0,m_numberOfDice); foreach(Die* tmp,diceList.mid(m_numberOfDice,-1)) { tmp->setHighlighted(false); diff --git a/node/parenthesesnode.cpp b/node/parenthesesnode.cpp index 2876147..f81fc1c 100644 --- a/node/parenthesesnode.cpp +++ b/node/parenthesesnode.cpp @@ -22,6 +22,7 @@ #include "parenthesesnode.h" ParenthesesNode::ParenthesesNode() + : m_internalNode(NULL) { } diff --git a/node/scalaroperatornode.cpp b/node/scalaroperatornode.cpp index c5f91f9..d532df0 100644 --- a/node/scalaroperatornode.cpp +++ b/node/scalaroperatornode.cpp @@ -26,7 +26,7 @@ ScalarOperatorNode::ScalarOperatorNode() - : m_internalNode(NULL),m_scalarResult(new ScalarResult()) + : m_internalNode(NULL),m_scalarResult(new ScalarResult()),m_operator(PLUS) { m_scalarOperationList.insert('+',PLUS); m_scalarOperationList.insert('-',MINUS); diff --git a/node/sortresult.cpp b/node/sortresult.cpp index 44a25f0..421beb3 100644 --- a/node/sortresult.cpp +++ b/node/sortresult.cpp @@ -54,14 +54,11 @@ void SortResultNode::run(ExecutionNode* node) bool found = false; int start = 0; int end = diceList2.size(); - int distance = 0; Die* tmp2 = NULL; while(!found) { - distance = end-start; + int distance = end-start; j = (start+end)/2; - - if(distance == 0) { j=end; @@ -78,9 +75,7 @@ void SortResultNode::run(ExecutionNode* node) { start=j+1; } - } - } diceList2.insert(j,tmp1); } diff --git a/parsingtoolbox.cpp b/parsingtoolbox.cpp index f6b1f12..2d26d79 100644 --- a/parsingtoolbox.cpp +++ b/parsingtoolbox.cpp @@ -75,7 +75,6 @@ Validator* ParsingToolBox::readValidator(QString& str) { Validator* returnVal=NULL; bool expectSquareBrasket=false; - bool isOk = true; if((str.startsWith("["))) { str=str.remove(0,1); @@ -83,11 +82,13 @@ Validator* ParsingToolBox::readValidator(QString& str) } BooleanCondition::LogicOperator myLogicOp = BooleanCondition::Equal; - bool hasReadLogicOperator = readLogicOperator(str,myLogicOp); + //bool hasReadLogicOperator = + readLogicOperator(str,myLogicOp); int value=0; if(readNumber(str,value)) { + bool isOk = true; if(str.startsWith("-")) { str=str.remove(0,1); diff --git a/result/result.cpp b/result/result.cpp index 257045c..161cfea 100644 --- a/result/result.cpp +++ b/result/result.cpp @@ -22,7 +22,7 @@ #include "result.h" Result::Result() - : m_previous(NULL) + : m_previous(NULL),m_resultTypes(STRING) { } -- cgit v1.2.3-70-g09d2 From 6cfbebcde11e9256e88f9b9be0d340c2fda2a40f Mon Sep 17 00:00:00 2001 From: Renaud G Date: Tue, 1 Sep 2015 16:33:17 +0200 Subject: add gpl header --- node/startingnode.cpp | 21 +++++++++++++++++++-- node/startingnode.h | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) (limited to 'node') diff --git a/node/startingnode.cpp b/node/startingnode.cpp index b15101b..7e13f5d 100644 --- a/node/startingnode.cpp +++ b/node/startingnode.cpp @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2015 by Renaud Guezennec * + * http://renaudguezennec.homelinux.org/accueil,3.html * + * * + * rolisteam is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #include "startingnode.h" #include @@ -24,7 +43,5 @@ qint64 StartingNode::getPriority() const { priority = m_nextNode->getPriority(); } - - return priority; } diff --git a/node/startingnode.h b/node/startingnode.h index ebe28c0..1edebc9 100644 --- a/node/startingnode.h +++ b/node/startingnode.h @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2015 by Renaud Guezennec * + * http://renaudguezennec.homelinux.org/accueil,3.html * + * * + * rolisteam is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #ifndef STARTINGNODE_H #define STARTINGNODE_H @@ -31,3 +50,4 @@ public: }; #endif // STARTINGNODE_H + -- cgit v1.2.3-70-g09d2 From 28867d0554db6cc68d295e41927e31f7e27fe135 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Tue, 1 Sep 2015 16:33:41 +0200 Subject: add gpl header --- node/helpnode.cpp | 19 +++++++++++++++++++ node/helpnode.h | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'node') diff --git a/node/helpnode.cpp b/node/helpnode.cpp index 62dc86e..dd5f087 100644 --- a/node/helpnode.cpp +++ b/node/helpnode.cpp @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2015 by Renaud Guezennec * + * http://renaudguezennec.homelinux.org/accueil,3.html * + * * + * rolisteam is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #include "helpnode.h" HelpNode::HelpNode() diff --git a/node/helpnode.h b/node/helpnode.h index 88a0842..be21b67 100644 --- a/node/helpnode.h +++ b/node/helpnode.h @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2015 by Renaud Guezennec * + * http://renaudguezennec.homelinux.org/accueil,3.html * + * * + * rolisteam is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #ifndef HELPNODE_H #define HELPNODE_H #include "executionnode.h" -- cgit v1.2.3-70-g09d2