]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMApplication.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMApplication.cpp
index e8af2cf6649aac6d578c2972aa63146c34aea20e..57770444d31e13ad6df5c98617f5b83ab7a9cb1e 100644 (file)
@@ -47,6 +47,7 @@ modelCDMApplication::modelCDMApplication()
 
 modelCDMApplication::modelCDMApplication(const std::string& path, const std::string& name, const int& level)
 {
+  std::cout << "creating application: " + path + "\n";
   //folder name
   this->name = name;
   //path
@@ -129,6 +130,7 @@ modelCDMApplication::modelCDMApplication(const std::string& path, const std::str
         }
     }
   this->SortChildren();
+  std::sort(this->folders.begin(), this->folders.end(), CompareNodeItem);
 }
 
 modelCDMApplication::~modelCDMApplication()
@@ -204,6 +206,7 @@ modelCDMFolder* modelCDMApplication::CreateFolder(const std::string& name, std::
 
 const bool modelCDMApplication::Refresh(std::string*& result)
 {
+  std::cout << "refreshing application: " << this->executableName << std::endl;
   //set attributes
   this->type = wxDIR_DIRS;
 
@@ -257,7 +260,7 @@ const bool modelCDMApplication::Refresh(std::string*& result)
           std::string applicationName = stdfileName;
           //check if they already exist
           bool found = false;
-          for (int i = 0;!found && i < this->folders.size(); i++)
+          for (int i = 0; !found && i < this->folders.size(); i++)
             {
               if (this->folders[i]->GetName() == applicationName)
                 {
@@ -303,7 +306,7 @@ const bool modelCDMApplication::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)
                     {