//std::cout << "executing " << add << std::endl;
system(add.c_str());
+ if(this->project != NULL)
+ {
+ if (!CloseProject(result))
+ return false;
+ }
this->project = new modelCDMProject(nomDirectory);
//if is source folder
if(isSource)
{
+ if(this->project != NULL)
+ {
+ if (!CloseProject(result))
+ return false;
+ }
+
std::cout << "Project sources at: " << pathSource << std::endl;
if(isBinary)
{
std::string*& result
)
{
- //TODO: recreate the project using the project's path
- return true;
+ //recreate the project using the project's path
+ if (this->project != NULL)
+ {
+ return this->project->Refresh(result);
+ }
+ else
+ {
+ result = new std::string("There is no open project.");
+ return false;
+ }
}
bool modelCDMMain::CloseProject(
std::string*& result
)
{
- //TODO: delete the project tree and leave it as NULL
- return true;
+ //delete the project tree and leave it as NULL
+ if (this->project != NULL)
+ {
+ delete this->project;
+ this->project = NULL;
+ return true;
+ }
+ else
+ {
+ result = new std::string("There is no open project.");
+ return false;
+ }
}