]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
isComponent() method is fully implemented.
authorasv <asv@opencascade.com>
Thu, 26 Jan 2006 09:16:22 +0000 (09:16 +0000)
committerasv <asv@opencascade.com>
Thu, 26 Jan 2006 09:16:22 +0000 (09:16 +0000)
src/LightApp/LightApp_Study.cxx

index e6b6f04a28c29440b4287d508002f6b1f6d65d07..b32f4945eda54f9c1d118b6dfd4419d66b65c49a 100644 (file)
@@ -264,6 +264,18 @@ void LightApp_Study::children( const QString&, QStringList& ) const
 //================================================================
 bool LightApp_Study::isComponent( const QString& entry ) const
 {
+  if( !root() )
+    return false;
+
+  DataObjectList ch;
+  root()->children( ch );
+  DataObjectList::const_iterator anIt = ch.begin(), aLast = ch.end();
+  for( ; anIt!=aLast; anIt++ )
+  {
+    LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( *anIt );
+    if( obj && obj->entry()==entry )
+      return true;
+  }
   return false;
 }