]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix SWP12966 - Multifile is not saved.
authorskt <skt@opencascade.com>
Tue, 22 Aug 2006 08:50:55 +0000 (08:50 +0000)
committerskt <skt@opencascade.com>
Tue, 22 Aug 2006 08:50:55 +0000 (08:50 +0000)
src/VISU_I/VISU_Gen_i.cc

index 6c890eabef1e13b8693aa01954d9d5766a4e419c..b462efcba617d6742aaa735c66f6482758968b2b 100644 (file)
@@ -338,21 +338,11 @@ namespace VISU
            std::string aCommand = aStream.str();
 
                        QString comm = QDir::convertSeparators( QString(aCommand.c_str()) ); 
-                       const char* cp = comm.latin1();
-
-                       
-                       QProcess* proc = new QProcess();
-                       proc->addArgument( comm );
-                       if(!proc->start())
-                       {
-                               INFOS("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
+       
+                       if(system(comm.latin1())){
+             INFOS("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
              continue;
-                       }
-                       
-                       //if(system(aCommand.c_str()) != 0){
-           //  INFOS("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
-           //  continue;
-           //}
+           }
          }
          aFileNames.push_back(aFileName);
          aFiles.push_back(aFile);
@@ -409,30 +399,20 @@ namespace VISU
          QString aPrefix("");
          if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str();
          QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
+               QString tmpDir = QDir::convertSeparators( QString(aTmpDir.ToCString()) );;
          static QString aCommand;
-         aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
-
-               QString comm = QDir::convertSeparators( aCommand ); 
-
-               QProcess* proc = new QProcess();
-               proc->addArgument( comm );
-               if(!proc->start())
-               {
-                       if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<<aCommand);
+         aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),tmpDir.latin1(),aFileName.latin1());
+               
+               if(system(aCommand.latin1())){
+           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<<aCommand);
            continue;
-               }
-               else
+         }else
            if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aCommand);
-         //int aRes = system(aCommand);
-         //if(aRes){
-         //  if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<<aCommand);
-         //  continue;
-         //}else
-         //  if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aCommand);
 
+               QString studyPath = tmpDir.append(aFileName);
          TCollection_AsciiString aString((char *)(aFileName.latin1()));
 
-         HDFascii::ConvertFromHDFToASCII(strdup((aTmpDir + aString).ToCString()), true);
+               HDFascii::ConvertFromHDFToASCII(strdup(studyPath.latin1()), true);
 
          aFileNames.Append(aString);
        }}