]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Fix a bug: temporary directory should be cleaned each time when starting installation
authorvsr <vsr@opencascade.com>
Mon, 7 Feb 2005 14:31:19 +0000 (14:31 +0000)
committervsr <vsr@opencascade.com>
Mon, 7 Feb 2005 14:31:19 +0000 (14:31 +0000)
src/SALOME_InstallWizard.cxx
src/SALOME_InstallWizard.hxx

index f1da8bc1c5e07a142394dab773c475d36fbe706a..98b8467f81d6725d3e1e168422e91e53e2f805f4 100644 (file)
@@ -880,6 +880,8 @@ bool SALOME_InstallWizard::acceptData( const QString& pageTitle )
                             QMessageBox::NoButton );
       return false;
     }
+    qApp->sendPostedEvents();
+    qApp->processEvents();
 // VSR: <------------------------------------------------------------------------------
     // ########## check native products
     QCheckListItem* item = (QCheckListItem*)( productsView->firstChild() );
@@ -1333,7 +1335,7 @@ void SALOME_InstallWizard::reject()
     }
     exitConfirmed = true;
   }
-  clean();
+  clean(true);
   InstallWizard::reject();
 }
 // ================================================================
@@ -1345,16 +1347,16 @@ void SALOME_InstallWizard::reject()
 void SALOME_InstallWizard::accept()
 {
   ___MESSAGE___( "ACCEPTED" );
-  clean();
+  clean(true);
   InstallWizard::accept();
 }
 // ================================================================
 /*!
  *  SALOME_InstallWizard::clean
- *  Clears and removes temporary directory
+ *  Clears and (optionally) removes temporary directory
  */
 // ================================================================
-void SALOME_InstallWizard::clean()
+void SALOME_InstallWizard::clean(bool rmDir)
 {
   // VSR: first remove temporary files
   QString script = "cd ./config_files/; remove_tmp.sh '";
@@ -1367,7 +1369,7 @@ void SALOME_InstallWizard::clean()
   }
   // VSR: then try to remove created temporary directory
   //script = "rm -rf " + QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME;
-  if ( !tmpCreated.isNull() ) {
+  if ( rmDir && !tmpCreated.isNull() ) {
     script = "rm -rf " + tmpCreated;
     script += " > /dev/null";
     if ( system( script.latin1() ) ) {
@@ -1513,6 +1515,7 @@ void SALOME_InstallWizard::onStart()
   }
   // if something at all is selected
   if ( !toInstall.isEmpty() ) {
+    clean(false); // VSR 07/02/05 - bug fix: first we should clear temporary directory
     // disable <Next> button
     nextButton()->setEnabled( false );
     // disable <Back> button
index c966cd04df1d9f2f9aa974ad20ce22d7774aabb8..8ea1a0170a580d3ad0988122f35aff012d3d7349 100644 (file)
@@ -169,8 +169,8 @@ class SALOME_InstallWizard: public InstallWizard
   QCheckListItem* findItem( const QString& sName );
   // sets progress state to Aborted
   void abort();
-  // clears and removes temporary directory
-  void clean();
+  // clears and (optionally) removes temporary directory
+  void clean(bool rmDir = false);
 
  protected slots:
   // reject slot