+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
//*********************************************************************************
// SUIT_FileDlg class is the extension of the Qt's Open/Save file dialog box.
// To get the file/directory name(s) call static methods:
if ( myValidator )
{
if ( isOpenDlg() )
- if ( mode() == ExistingFiles ) {
- QStringList fileNames = selectedFiles();
- for ( int i = 0; i < (int)fileNames.count(); i++ ) {
- if ( !myValidator->canOpen( fileNames[i] ) )
- return false;
- }
- return true;
+ {
+ if ( mode() == ExistingFiles )
+ {
+ QStringList fileNames = selectedFiles();
+ for ( int i = 0; i < (int)fileNames.count(); i++ )
+ {
+ if ( !myValidator->canOpen( fileNames[i] ) )
+ return false;
+ }
+ return true;
}
- else {
- return myValidator->canOpen( selectedFile() );
+ else
+ {
+ return myValidator->canOpen( selectedFile() );
}
- else
+ }
+ else
return myValidator->canSave( selectedFile() );
}
return true;
{
QString newExt = extList[i].replace( QRegExp( "[\\\\][+]" ),"+" );
int res = newExt.findRev( '.' );
- if ( res >= 0 )
+ if ( res >= 0 )
newExt = newExt.mid( res + 1 );
- if ( newExt.find( QRegExp("[*|?]" ) ) < 0 ) {
+ if ( newExt.find( QRegExp("[*|?]" ) ) < 0 )
+ {
mySelectedFile.stripWhiteSpace();
mySelectedFile += mySelectedFile.endsWith(".") ? newExt : QString(".") + newExt;
break;