]> AND Private Git Repository - blast.git/blobdiff - BlockCategory.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
after merge
[blast.git] / BlockCategory.cpp
index 0de4d869a5ef4541e434bc2e31acca108327e4cc..1e70385a8f5785c53e41d665cf7bbcab258ed706 100644 (file)
@@ -34,7 +34,7 @@ QList<BlockCategory *> BlockCategory::getAllChilds()
     return childs;\r
 }\r
 \r
-ReferenceBlock *BlockCategory::getBlock(int index) {\r
+ReferenceBlock *BlockCategory::getBlockById(int index) {\r
     if ((index >=0) && (index < blocks.size()) ) {\r
     return blocks.at(index);\r
   }\r
@@ -42,6 +42,14 @@ ReferenceBlock *BlockCategory::getBlock(int index) {
   return NULL;\r
 }\r
 \r
+ReferenceBlock *BlockCategory::getBlockByName(QString name) {\r
+  foreach(ReferenceBlock* block, blocks) {\r
+    if (block->getName() == name) return block;\r
+  }\r
+  cout << "block null!" << endl;\r
+  return NULL;\r
+}\r
+\r
 QDomElement BlockCategory::save(QDomDocument &doc) {\r
 }\r
 \r