From fbec29c8fc7920b836b3569f98b5b8f2307385ec Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 22 Jun 2009 12:02:54 +0000 Subject: [PATCH] Issue 0020398: EDF 1052 GEOM: Import error of IGES file --- src/SUIT/SUIT_FileDlg.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SUIT/SUIT_FileDlg.cxx b/src/SUIT/SUIT_FileDlg.cxx index a3cb690f3..cadb8fa96 100755 --- a/src/SUIT/SUIT_FileDlg.cxx +++ b/src/SUIT/SUIT_FileDlg.cxx @@ -79,6 +79,7 @@ #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "SUIT_FileValidator.h" +#include "Qtx.h" #include #include @@ -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() ); } -- 2.39.2