]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMAppli.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMAppli.cpp
index 417392792399e8024b7eed70ae5b7101c762f655..7669853356dd585c5e5a207abb3c7e82e1706221 100644 (file)
@@ -46,9 +46,10 @@ modelCDMAppli::modelCDMAppli()
 {
 }
 
-modelCDMAppli::modelCDMAppli(const std::string& path, const std::string& name, const int& level)
+modelCDMAppli::modelCDMAppli(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating appli\n";
+  this->parent = parent;
   this->type = wxDIR_DIRS;
   this->name = name;
   this->level = level;
@@ -71,13 +72,13 @@ modelCDMAppli::modelCDMAppli(const std::string& path, const std::string& name, c
 
           if(stdfileName != "template_appli" && stdfileName != "template_wx_appli")
             {
-              modelCDMApplication* application = new modelCDMApplication(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMApplication* application = new modelCDMApplication(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->applications.push_back(application);
               this->children.push_back(application);
             }
           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);
             }
 
@@ -92,13 +93,13 @@ modelCDMAppli::modelCDMAppli(const std::string& path, const std::string& name, c
           //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 @@ modelCDMApplication* modelCDMAppli::CreateApplication(
     }
 
   //add application to model
-  modelCDMApplication* application = new modelCDMApplication(this->path + CDMUtilities::SLASH + name, name, this->level + 1);
+  modelCDMApplication* application = new modelCDMApplication(this, this->path + CDMUtilities::SLASH + name, name, this->level + 1);
   this->applications.push_back(application);
   this->children.push_back(application);
 
@@ -203,7 +204,7 @@ const bool modelCDMAppli::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMApplication* application= new modelCDMApplication(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMApplication* application= new modelCDMApplication(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->applications.push_back(application);
                   this->children.push_back(application);
                 }
@@ -225,7 +226,7 @@ const bool modelCDMAppli::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);
                 }
             }
@@ -242,7 +243,7 @@ const bool modelCDMAppli::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
@@ -270,7 +271,7 @@ const bool modelCDMAppli::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);
                 }
             }