From: eap Date: Thu, 12 May 2005 12:17:14 +0000 (+0000) Subject: IPAL8763. Fix for the pb that okClicked() is called twice if you validate X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=28e758c7c66bb32bf398b73944233fd97566a1d0;p=modules%2Fkernel.git IPAL8763. Fix for the pb that okClicked() is called twice if you validate the selected file name by pressing 'Return' key in file name editor --- diff --git a/src/PatchQt/qfiledialogP.cxx b/src/PatchQt/qfiledialogP.cxx index 0b3ca637b..af0db64e4 100644 --- a/src/PatchQt/qfiledialogP.cxx +++ b/src/PatchQt/qfiledialogP.cxx @@ -2507,8 +2507,12 @@ void QFileDialogP::fileNameEditReturnPressed() } } nameEdit->setText( QString::null ); - d->ignoreReturn = TRUE; + // Fix for the pb that okClicked() is called twice if you validate + // the selected file name by pressing 'Return' key in file name editor: + // ignoreReturn = TRUE for all modes + //d->ignoreReturn = TRUE; } + d->ignoreReturn = TRUE; } /*! @@ -3283,11 +3287,18 @@ void QFileDialogP::okClicked() detailViewMode = files->isVisible(); *lastSize = size(); + // Fix for the pb that okClicked() is called twice if you validate + // the selected file name by pressing 'Return' key in file name editor: + // check ignoreReturn for all modes, not only if ( isDirectoryMode( d->mode ) ) + if ( d->ignoreReturn ) { + d->ignoreReturn = FALSE; + return; + } if ( isDirectoryMode( d->mode ) ) { - if ( d->ignoreReturn ) { - d->ignoreReturn = FALSE; - return; - } +// if ( d->ignoreReturn ) { +// d->ignoreReturn = FALSE; +// return; +// } QUrlInfo f( d->url, nameEdit->text() ); if ( f.isDir() ) { d->currentFileName = d->url;