#include "modelCDMAppli.h"
+#include "CDMUtilities.h"
#include "creaWx.h"
#include "wx/dir.h"
this->name = "appli";
this->level = level;
this->path = path;
+
+
+
+ this->path = CDMUtilities::fixPath(path);
+ //open makelists file
+ std::string pathFixed(CDMUtilities::fixPath(path));
+
+ this->applications.clear();
+ wxDir dir(crea::std2wx((pathFixed).c_str()));
+ if (dir.IsOpened())
+ {
+ wxString fileName;
+ bool cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_DIRS);
+ while (cont)
+ {
+ std::string stdfileName = crea::wx2std(fileName);
+
+ modelCDMApplication* application = new modelCDMApplication(pathFixed + "/" + stdfileName, this->level + 1);
+ this->applications.push_back(application);
+ this->children.push_back(application);
+
+ cont = dir.GetNext(&fileName);
+ }
+
+ }
+ this->SortChildren();
}
modelCDMAppli::~modelCDMAppli()
{
+ for (int i = 0; i < this->applications.size(); i++)
+ {
+ if(this->applications[i] != NULL)
+ {
+ delete this->applications[i];
+ this->applications[i] = NULL;
+ }
+ }
}
bool modelCDMAppli::CreateApplication(