From: vsr Date: Mon, 7 Feb 2005 14:31:19 +0000 (+0000) Subject: Fix a bug: temporary directory should be cleaned each time when starting installation X-Git-Tag: SALOME_V_2_2_0~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1a31ff85ff5def6b1394641cb47fee572da531cf;p=tools%2Finstall.git Fix a bug: temporary directory should be cleaned each time when starting installation --- diff --git a/src/SALOME_InstallWizard.cxx b/src/SALOME_InstallWizard.cxx index f1da8bc..98b8467 100644 --- a/src/SALOME_InstallWizard.cxx +++ b/src/SALOME_InstallWizard.cxx @@ -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 button nextButton()->setEnabled( false ); // disable button diff --git a/src/SALOME_InstallWizard.hxx b/src/SALOME_InstallWizard.hxx index c966cd0..8ea1a01 100644 --- a/src/SALOME_InstallWizard.hxx +++ b/src/SALOME_InstallWizard.hxx @@ -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