diff options
| author | 2015-03-24 21:53:40 +0100 | |
|---|---|---|
| committer | 2015-03-24 21:53:40 +0100 | |
| commit | 7ed106bc79c222586279d4351db1c5f005b0b1f3 (patch) | |
| tree | ff0efc466457d10431a85c3f23fc1a154dcdc26c /node/listaliasnode.cpp | |
| parent | 24d48effb863e458c00dcb1bea1ad5aa82309599 (diff) | |
| download | OneRoll-7ed106bc79c222586279d4351db1c5f005b0b1f3.tar.gz OneRoll-7ed106bc79c222586279d4351db1c5f005b0b1f3.zip | |
-Add listaliasnode to list all alias.
Diffstat (limited to 'node/listaliasnode.cpp')
| -rw-r--r-- | node/listaliasnode.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/node/listaliasnode.cpp b/node/listaliasnode.cpp new file mode 100644 index 0000000..1d50c80 --- /dev/null +++ b/node/listaliasnode.cpp @@ -0,0 +1,46 @@ +#include "listaliasnode.h" + +ListAliasNode::ListAliasNode(QMap<QString,QString>* apAlias) + : m_mapAlias(apAlias) +{ + m_result = new StringResult(); +} +void ListAliasNode::run(ExecutionNode* previous ) +{ + m_previousNode = previous; + StringResult* txtResult = dynamic_cast<StringResult*>(m_result); + + if(NULL != previous) + { + if(previous->getResult() == NULL) + { + txtResult->setText(toString()); + + } + else + { + txtResult->setText(previous->getHelp()); + } + m_result->setPrevious(previous->getResult()); + } + + if(NULL!=m_nextNode) + { + m_nextNode->run(this); + } +} +QString ListAliasNode::toString()const +{ + QString result(QObject::tr("List of Alias:\n")); + foreach(QString key, m_mapAlias->keys()) + { + result+=QString("%1 : %2\n").arg(key).arg(m_mapAlias->value(key)); + } + + return result; +} + +qint64 ListAliasNode::getPriority() const +{ + return 0; +} |