Salome HOME
Remove files only if asked by the user V9_11_0a1 V9_11_0a2 V9_11_0b1
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Thu, 27 Apr 2023 14:03:18 +0000 (16:03 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Thu, 27 Apr 2023 14:03:18 +0000 (16:03 +0200)
src/HexoticPlugin/HexoticPlugin_Hexotic.cxx

index 9413d17d4f2c87b3fa4d5fa29775eb15816555e1..dc8c9644613699f9e05a07306e603b8c96eefd94 100644 (file)
@@ -1171,8 +1171,6 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          aMesh,
 
     if ( !_keepFiles )
     {
-      if (! Ok && _computeCanceled )
-        removeFile( aLogFileName );
       removeFile(Hexotic_Out);
       removeFile(Hexotic_In);
       for ( size_t i = 0; i < sizeMapFiles.size(); i++ )
@@ -1291,16 +1289,19 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
   std::cout << "Hexahedra meshing " << hexahedraMessage << std::endl;
   std::cout << std::endl;
 
-  if(_computeCanceled)
+  if (_computeCanceled)
     return error(SMESH_Comment("interruption initiated by user"));
-  removeFile(Hexotic_Out);
-  removeFile(Hexotic_In);
-  if ( Ok )
-    removeFile(aLogFileName);
-  for( size_t i=0; i<sizeMapFiles.size(); i++)
+  if ( !_keepFiles )
   {
-    removeFile( TCollection_AsciiString(sizeMapFiles[i].c_str()) );
+    removeFile(Hexotic_Out);
+    removeFile(Hexotic_In);
+    for( size_t i=0; i<sizeMapFiles.size(); i++)
+    {
+      removeFile( TCollection_AsciiString(sizeMapFiles[i].c_str()) );
+    }
   }
+  if ( Ok && _removeLogOnSuccess )
+    removeFile(aLogFileName);
   return Ok;
 }