]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Issue 0020398: EDF 1052 GEOM: Import error of IGES file V5_1_2rc3
authorvsr <vsr@opencascade.com>
Mon, 22 Jun 2009 12:02:54 +0000 (12:02 +0000)
committervsr <vsr@opencascade.com>
Mon, 22 Jun 2009 12:02:54 +0000 (12:02 +0000)
src/SUIT/SUIT_FileDlg.cxx

index a3cb690f339196b6b9bf9aa4a7591ffdd56bfa49..cadb8fa966792219c62002109665e5c25b709ee3 100755 (executable)
@@ -79,6 +79,7 @@
 #include "SUIT_MessageBox.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_FileValidator.h"
+#include "Qtx.h"
 
 #include <QDir>
 #include <QEvent>
@@ -497,6 +498,9 @@ QString SUIT_FileDlg::addExtension( const QString& fileName ) const
   QRegExp r( QString::fromLatin1("\\(?[a-zA-Z0-9.*? +;#|]*\\)?$") );
   int index = r.indexIn( selectedFilter().trimmed() );
 
+  if ( QFileInfo( fileName ).exists() )
+    return fileName; // if file exists return as is
+
   if ( index >= 0 ) {            
     // Create wildcard regular expression basing on selected filter 
     // in order to validate a file extension.
@@ -981,5 +985,6 @@ QString SUIT_FileDlg::getLastVisitedPath()
 void SUIT_FileDlg::selectFile( const QString& f )
 {
   QFileDialog::selectFile( QFileInfo( f ).baseName() );
-  setDirectory( QFileInfo( f ).absoluteDir() );
+  if ( !Qtx::dir( f, false ).isEmpty() )
+    setDirectory( QFileInfo( f ).absolutePath() );
 }