]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
optimise code
authorptv <ptv@opencascade.com>
Wed, 17 Nov 2010 08:20:26 +0000 (08:20 +0000)
committerptv <ptv@opencascade.com>
Wed, 17 Nov 2010 08:20:26 +0000 (08:20 +0000)
src/CAM/CAM_Module.cxx

index 8e39ab66bb8e64ed6b931704794bd9ee17fa544a..e8415e344fd2bd9a98cf2629e71ba9c07f876734 100755 (executable)
@@ -951,12 +951,16 @@ void CAM_Module::connectToStudy( CAM_Study* camStudy )
   for( QList<CAM_Module*>::const_iterator it = mods.begin(); it != mods.end(); ++it )
   {
     CAM_DataModel* dm = (*it)->dataModel();
-    if( (*it) == this && !camStudy->containsDataModel( dm ) )
+    if( (*it) == this )
     {
-      if ( prev )
-        camStudy->insertDataModel( (*it)->dataModel(), prev );
-      else
-        camStudy->insertDataModel( (*it)->dataModel(), 0 );
+      if ( !camStudy->containsDataModel( dm ) )
+      {
+        if ( prev )
+          camStudy->insertDataModel( (*it)->dataModel(), prev );
+        else
+          camStudy->insertDataModel( (*it)->dataModel(), 0 );
+      }
+      return;
     }
     prev = dm;
   }