]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMAppli.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMAppli.cpp
index d15bc4f554bdb5dcc1255824f38b6972e59688ec..c92932a1c5583de3c0a9f6795d926fefe26cc13d 100644 (file)
@@ -48,6 +48,7 @@ modelCDMAppli::modelCDMAppli()
 
 modelCDMAppli::modelCDMAppli(const std::string& path, const std::string& name, const int& level)
 {
+  std::cout << "creating appli\n";
   this->type = wxDIR_DIRS;
   this->name = name;
   this->level = level;
@@ -97,6 +98,7 @@ modelCDMAppli::modelCDMAppli(const std::string& path, const std::string& name, c
 
     }
   this->SortChildren();
+  std::sort(this->applications.begin(), this->applications.end(), CompareNodeItem);
 }
 
 modelCDMAppli::~modelCDMAppli()
@@ -176,7 +178,7 @@ const bool modelCDMAppli::Refresh(std::string*& result)
           std::string applicationName = stdfileName;
           //check if they already exist
           bool found = false;
-          for (int i = 0;!found && i < this->applications.size(); i++)
+          for (int i = 0; !found && i < this->applications.size(); i++)
             {
               if (this->applications[i]->GetName() == applicationName)
                 {
@@ -222,7 +224,7 @@ const bool modelCDMAppli::Refresh(std::string*& result)
           else
             {
               bool found = false;
-              for (int i = 0; i <!found && this->children.size(); i++)
+              for (int i = 0; !found && i < this->children.size(); i++)
                 {
                   if (this->children[i]->GetName() == stdfileName)
                     {
@@ -264,5 +266,6 @@ const bool modelCDMAppli::Refresh(std::string*& result)
         }
     }
   this->SortChildren();
+  std::sort(this->applications.begin(), this->applications.end(), CompareNodeItem);
   return true;
 }