]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Qt4 porting. Save and Open operations are incorrect when unreadable symbol is used...
authordmv <dmv@opencascade.com>
Thu, 20 Nov 2008 13:14:33 +0000 (13:14 +0000)
committerdmv <dmv@opencascade.com>
Thu, 20 Nov 2008 13:14:33 +0000 (13:14 +0000)
src/SUIT/SUIT_FileDlg.cxx

index 7572fba75a45bb4244dcc5394f9c1620579b6b43..863b0659084314f48d45841f5b0b7d29e31e0b5f 100755 (executable)
@@ -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();