From: vsr Date: Mon, 22 Jun 2009 12:02:54 +0000 (+0000) Subject: Issue 0020398: EDF 1052 GEOM: Import error of IGES file X-Git-Tag: V5_1_2rc3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fbec29c8fc7920b836b3569f98b5b8f2307385ec;p=modules%2Fgui.git Issue 0020398: EDF 1052 GEOM: Import error of IGES file --- 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() ); }