From 28e758c7c66bb32bf398b73944233fd97566a1d0 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 12 May 2005 12:17:14 +0000 Subject: [PATCH] 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 --- src/PatchQt/qfiledialogP.cxx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) 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; -- 2.39.2