From: dmv Date: Thu, 20 Nov 2008 13:14:33 +0000 (+0000) Subject: Qt4 porting. Save and Open operations are incorrect when unreadable symbol is used... X-Git-Tag: PARAVIS_TEST~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b6819df660624492d83895ec1256c38e05f6c644;p=modules%2Fgui.git Qt4 porting. Save and Open operations are incorrect when unreadable symbol is used in name. --- diff --git a/src/SUIT/SUIT_FileDlg.cxx b/src/SUIT/SUIT_FileDlg.cxx index 7572fba75..863b06590 100755 --- a/src/SUIT/SUIT_FileDlg.cxx +++ b/src/SUIT/SUIT_FileDlg.cxx @@ -731,6 +731,10 @@ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, fd.setFileMode( open ? ExistingFile : AnyFile ); + QString filename = initial; + filename.simplified(); + filename = filename.replace(QRegExp("\\*"), "" ).replace(QRegExp("\\?"), "" ); + if ( filters.isEmpty() ) fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*) else @@ -739,14 +743,12 @@ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, if ( !caption.isEmpty() ) fd.setWindowTitle( caption ); - if ( !initial.isEmpty() ) - fd.processPath( initial ); + if ( !filename.isEmpty() ) + fd.processPath( filename ); if ( validator ) fd.setValidator( validator ); - QString filename; - if ( fd.exec() == QDialog::Accepted ) filename = fd.selectedFile();