X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcreaDevManagerLib%2FmodelCDMAppli.cpp;h=2bba913c0f7b98255fe3b77ff0a3a29915d22937;hb=bfb323227654cb712d5cc3b05774877201d59bd7;hp=ee7edc1d54851f82279ce5cb791bbda2d7f820b0;hpb=e2223b619fa37daaf6103b34b39e789efc1a0b94;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMAppli.cpp b/lib/creaDevManagerLib/modelCDMAppli.cpp index ee7edc1..2bba913 100644 --- a/lib/creaDevManagerLib/modelCDMAppli.cpp +++ b/lib/creaDevManagerLib/modelCDMAppli.cpp @@ -34,10 +34,48 @@ #include "modelCDMAppli.h" +#include "CDMUtilities.h" +#include "creaWx.h" +#include "wx/dir.h" + modelCDMAppli::modelCDMAppli() { } +modelCDMAppli::modelCDMAppli(const std::string& path, const int& level) +{ + this->type = wxDIR_DIRS; + 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() { } @@ -58,7 +96,7 @@ bool modelCDMAppli::OpenCMakeListsFile(std::string*& result) return true; } -bool modelCDMAppli::Refresh(std::string*& result) +const bool modelCDMAppli::Refresh(std::string*& result) { //TODO: implement method return true;