]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMLib.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMLib.cpp
index 16211eed4ade6c269d87e23b93971cda679d397a..a040ae8b05ce283062bbb253792d723a4ea40001 100644 (file)
@@ -45,9 +45,10 @@ modelCDMLib::modelCDMLib()
 {
 }
 
-modelCDMLib::modelCDMLib(const std::string& path, const std::string& name, const int& level)
+modelCDMLib::modelCDMLib(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating lib\n";
+  this->parent = parent;
   this->type = wxDIR_DIRS;
   this->name = name;
   this->level = level;
@@ -72,13 +73,13 @@ modelCDMLib::modelCDMLib(const std::string& path, const std::string& name, const
 
           if(stdfileName != "template_lib")
             {
-              modelCDMLibrary* library = new modelCDMLibrary(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMLibrary* library = new modelCDMLibrary(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->libraries.push_back(library);
               this->children.push_back(library);
             }
           else
             {
-              modelCDMFolder* folder = new modelCDMFolder(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMFolder* folder = new modelCDMFolder(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(folder);
             }
 
@@ -93,13 +94,13 @@ modelCDMLib::modelCDMLib(const std::string& path, const std::string& name, const
           //if CMakeLists, create CMakeLists
           if(stdfileName == "CMakeLists.txt")
             {
-              this->CMakeLists = new modelCDMCMakeListsFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->CMakeLists = new modelCDMCMakeListsFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->CMakeLists);
             }
           //if is an unknown file, create file
           else
             {
-              this->children.push_back(new modelCDMFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
 
           cont = dir.GetNext(&fileName);
@@ -156,7 +157,7 @@ modelCDMLibrary* modelCDMLib::CreateLibrary(
     }
 
   //add library to model
-  modelCDMLibrary* library = new modelCDMLibrary(this->path + CDMUtilities::SLASH + name, name, this->level + 1);
+  modelCDMLibrary* library = new modelCDMLibrary(this, this->path + CDMUtilities::SLASH + name, name, this->level + 1);
   this->libraries.push_back(library);
   this->children.push_back(library);
 
@@ -205,7 +206,7 @@ const bool modelCDMLib::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMLibrary* library = new modelCDMLibrary(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMLibrary* library = new modelCDMLibrary(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->libraries.push_back(library);
                   this->children.push_back(library);
                 }
@@ -226,7 +227,7 @@ const bool modelCDMLib::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMFolder* folder= new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFolder* folder= new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(folder);
                 }
             }
@@ -243,7 +244,7 @@ const bool modelCDMLib::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -271,7 +272,7 @@ const bool modelCDMLib::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(file);
                 }
             }