From ae25995662a4f6f76bf1f341f0c4130b8422c4f6 Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 9 Jun 2005 10:18:21 +0000 Subject: [PATCH] BugID: IPAL9088 Added slot onBrwoserDestroyed() to synchronize a deletion of OB_Browser and SalomeApp_OBSelector. --- src/SalomeApp/SalomeApp_OBSelector.cxx | 10 +++++++++- src/SalomeApp/SalomeApp_OBSelector.h | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/SalomeApp/SalomeApp_OBSelector.cxx b/src/SalomeApp/SalomeApp_OBSelector.cxx index ab8b10990..22dd4ed1f 100644 --- a/src/SalomeApp/SalomeApp_OBSelector.cxx +++ b/src/SalomeApp/SalomeApp_OBSelector.cxx @@ -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& entires ) { entires.clear(); diff --git a/src/SalomeApp/SalomeApp_OBSelector.h b/src/SalomeApp/SalomeApp_OBSelector.h index 45a980b71..d4ffbd2e3 100644 --- a/src/SalomeApp/SalomeApp_OBSelector.h +++ b/src/SalomeApp/SalomeApp_OBSelector.h @@ -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; -- 2.39.2