#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_FileValidator.h"
+#include "Qtx.h"
#include <QDir>
#include <QEvent>
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.
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() );
}