]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
BugID: IPAL9088 Added slot onBrwoserDestroyed() to synchronize a deletion of OB_Brows...
authorsrn <srn@opencascade.com>
Thu, 9 Jun 2005 10:18:21 +0000 (10:18 +0000)
committersrn <srn@opencascade.com>
Thu, 9 Jun 2005 10:18:21 +0000 (10:18 +0000)
src/SalomeApp/SalomeApp_OBSelector.cxx
src/SalomeApp/SalomeApp_OBSelector.h

index ab8b10990df3e06198e8ded0276bfbe53d29755b..22dd4ed1f5cf5e1d650d7b8ced9cd9b1e80707d0 100644 (file)
@@ -12,8 +12,10 @@ SalomeApp_OBSelector::SalomeApp_OBSelector( OB_Browser* ob, SUIT_SelectionMgr* m
 SUIT_Selector( mgr ),
 myBrowser( ob )
 {
-  if ( myBrowser )
+  if ( myBrowser ) {
     connect( myBrowser, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
+    connect( myBrowser, SIGNAL( destroyed() ), this, SLOT( onBrowserDestroyed() ) ); 
+  }    
 }
 
 SalomeApp_OBSelector::~SalomeApp_OBSelector()
@@ -25,6 +27,7 @@ OB_Browser* SalomeApp_OBSelector::browser() const
   return myBrowser;
 }
 
+
 void SalomeApp_OBSelector::getSelection( SUIT_DataOwnerPtrList& list ) const
 {
   if ( !myBrowser )
@@ -68,6 +71,11 @@ void SalomeApp_OBSelector::onSelectionChanged()
   selectionChanged();
 }
 
+void SalomeApp_OBSelector::onBrowserDestroyed()
+{
+  delete this;
+}
+
 void SalomeApp_OBSelector::fillEntries( QMap<QString, SalomeApp_DataObject*>& entires )
 {
   entires.clear();
index 45a980b71142fc152a580754deb3640669fddb27..d4ffbd2e3e30db3bd4e4c7718a232d8e786720aa 100644 (file)
@@ -19,11 +19,14 @@ public:
   virtual ~SalomeApp_OBSelector();
 
   OB_Browser*  browser() const;
+
+  void setBrowser(OB_Browser* theBrowser);
   
   virtual QString type() const { return "ObjectBrowser"; }
 
 private slots:
   void         onSelectionChanged();
+  void         onBrowserDestroyed();
 
 protected:
   virtual void getSelection( SUIT_DataOwnerPtrList& ) const;