]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
FreeTemoraryFiles() method added to free locked directory with temporary files (its...
authorsln <sln@opencascade.com>
Fri, 21 Sep 2012 08:55:38 +0000 (08:55 +0000)
committersln <sln@opencascade.com>
Fri, 21 Sep 2012 08:55:38 +0000 (08:55 +0000)
src/LightApp/LightApp_Driver.cxx
src/LightApp/LightApp_Driver.h

index 15bf1452162f93f43283f23fcf7c49a8d69d15a5..b534201aa217cb2102761763867379bd6c17970a 100644 (file)
@@ -344,20 +344,7 @@ void LightApp_Driver::RemoveTemporaryFiles( const char* theModuleName, const boo
   // aFiles must contain temporary directory name in its first item
   // and names of files (relatively the temporary directory) in the others
 
-  if ( myBloc )
-  {
-    fclose( myBloc );
-    QString fName = Qtx::addSlash( aFiles.front().c_str() ) + "used_by_salome";
-    QFile::remove( fName );
-  }
-#ifndef WIN32
-  if ( myBlocFcntl )
-  {
-    fclose( myBlocFcntl );
-    QString fName = Qtx::addSlash( aFiles.front().c_str() ) + "used_by_salome.fcntl";
-    QFile::remove( fName );
-  }
-#endif
+  FreeTemporaryFiles( theModuleName );
 
   RemoveFiles( aFiles, IsDirDeleted );
 
@@ -931,3 +918,27 @@ void LightApp_Driver::PutNextStreamToFiles( ListOfFiles& theListOfFiles,
     }
   } // for
 }
+
+/*!
+  Free locked directory with temporary files
+*/
+void LightApp_Driver::FreeTemporaryFiles( const char* theModuleName )
+{
+  std::string aModuleName(theModuleName);
+  ListOfFiles aFiles = myMap[aModuleName];
+
+  if ( myBloc )
+  {
+    fclose( myBloc );
+    QString fName = Qtx::addSlash( aFiles.front().c_str() ) + "used_by_salome";
+    QFile::remove( fName );
+  }
+#ifndef WIN32
+  if ( myBlocFcntl )
+  {
+    fclose( myBlocFcntl );
+    QString fName = Qtx::addSlash( aFiles.front().c_str() ) + "used_by_salome.fcntl";
+    QFile::remove( fName );
+  }
+#endif
+}
index 1ef96c4e82097d349418bdec1a1ef07178bbef47..eeb726bfd803c8ce4eb097aca4ddff4a48a15a18 100644 (file)
@@ -57,6 +57,8 @@ public:
 
   virtual void        ClearDriverContents();
 
+  void                FreeTemporaryFiles( const char* theModuleName );
+
 protected:
   /*
   void                PutFilesToStream(const std::string& theModuleName, unsigned char*& theBuffer,