X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcreaDevManagerLib%2FmodelCDMIProjectTreeNode.cpp;h=fb02b7134175771239231defaec764f14c20461f;hb=311bdcc514f85386f3bbbef9ff6a88bf69fd930f;hp=1c9db624a2e58e1d387ccaf804e9933effca0517;hpb=f57f98a24c774785361ae5053f1510106da19052;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMIProjectTreeNode.cpp b/lib/creaDevManagerLib/modelCDMIProjectTreeNode.cpp index 1c9db62..fb02b71 100644 --- a/lib/creaDevManagerLib/modelCDMIProjectTreeNode.cpp +++ b/lib/creaDevManagerLib/modelCDMIProjectTreeNode.cpp @@ -23,7 +23,7 @@ # The fact that you are presently reading this means that you have had # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ -*/ + */ /* * modelCDMIProjectTreeNode.cpp @@ -34,6 +34,8 @@ #include "modelCDMIProjectTreeNode.h" #include +#include "CDMUtilities.h" + #include "wx/dir.h" bool modelCDMIProjectTreeNode::CompareNodeItem(const modelCDMIProjectTreeNode* x, const modelCDMIProjectTreeNode* y) @@ -47,37 +49,37 @@ bool modelCDMIProjectTreeNode::CompareNodeItem(const modelCDMIProjectTreeNode* x unsigned char yType = y->GetType(); while ((i < xName.length()) && (i < yName.length())) - { - if (tolower (xName[i]) < tolower (yName[i])) - { - noWinner = false; - returnValue = true; - break; - } - else if (tolower (xName[i]) > tolower (yName[i])) { - noWinner = false; - returnValue = false; - break; + if (tolower (xName[i]) < tolower (yName[i])) + { + noWinner = false; + returnValue = true; + break; + } + else if (tolower (xName[i]) > tolower (yName[i])) + { + noWinner = false; + returnValue = false; + break; + } + i++; } - i++; - } if(noWinner) - { - if (xName.length() < yName.length()) - returnValue = true; - else - returnValue = false; - } + { + if (xName.length() < yName.length()) + returnValue = true; + else + returnValue = false; + } if(xType != yType) - { - if(xType == wxDIR_DIRS) - returnValue = true; - else - returnValue = false; - } + { + if(xType == wxDIR_DIRS) + returnValue = true; + else + returnValue = false; + } return returnValue; } @@ -142,6 +144,11 @@ const int& modelCDMIProjectTreeNode::GetLength() const bool modelCDMIProjectTreeNode::OpenInFileExplorer(std::string*& result) const { - //TODO: implement method - return false; + if (!CDMUtilities::openFileExplorer(this->GetPath())) + return true; + else + { + result = new std::string("Couldn't open file."); + return false; + } }