]> SALOME platform Git repositories - modules/gui.git/blobdiff - src/SUIT/SUIT_FileDlg.cxx
Salome HOME
Copyrights update
[modules/gui.git] / src / SUIT / SUIT_FileDlg.cxx
index 7fe3754140544c30e0f75e4cbf0f0af0f70935a5..80a6ad5890b411b4191c320ca3720390c1c52262 100755 (executable)
@@ -1,3 +1,21 @@
+// 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:
@@ -249,18 +267,23 @@ bool SUIT_FileDlg::acceptData()
   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;
@@ -333,9 +356,10 @@ void SUIT_FileDlg::addExtension()
       {
         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;